Skip to content

Commit

Permalink
Drop PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Jul 26, 2021
1 parent 596ea01 commit 9c06b12
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 15
matrix:
operating-system: [ubuntu-latest, macOS-latest]
php-versions: ['7.3', '7.4', '8.0']
php-versions: ['7.4', '8.0']
# TODO : enable tests on windows
#include:
# - operating-system: windows-latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Many other options are available:

## Running Remotely

Copy the files from the repo to a web server that can run PHP 7.3.0 or newer.
Copy the files from the repo to a web server that can run PHP 7.4.0 or newer.

## Running Locally

Expand Down Expand Up @@ -235,7 +235,7 @@ To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, su

## PHP Requirements

Daux.io is compatible with the [officially supported](https://www.php.net/supported-versions.php) PHP versions; 7.3.0 and up.
Daux.io is compatible with the [officially supported](https://www.php.net/supported-versions.php) PHP versions; 7.4.0 and up.

### Extensions

Expand Down
2 changes: 1 addition & 1 deletion docs/00_Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Now that you got the basics, you can also [see what you can configure](05_Config

## PHP Requirements

Daux.io is compatible with the [officially supported](https://www.php.net/supported-versions.php) PHP versions; 7.3.0 and up.
Daux.io is compatible with the [officially supported](https://www.php.net/supported-versions.php) PHP versions; 7.4.0 and up.

### Extensions

Expand Down
2 changes: 1 addition & 1 deletion docs/01_Features/Live_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To enable the same, set the toggle in the `config.json` file in the `/docs` fold

### Apache

Copy the files from the repo to a web server that can run PHP 7.3.0 or newer.
Copy the files from the repo to a web server that can run PHP 7.4.0 or newer.

There is an included `.htaccess` for Apache web server.

Expand Down
6 changes: 2 additions & 4 deletions libs/ConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

class ConfigBuilder
{
/** @var Config */
private $config;
private Config $config;

/** @var array */
private $overrideValues = [];
private array $overrideValues = [];

private $configuration_override_file;

Expand Down
8 changes: 3 additions & 5 deletions libs/ContentTypes/Markdown/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

class ContentType implements \Todaymade\Daux\ContentTypes\ContentType
{
/** @var Config */
protected $config;
protected Config $config;

/** @var CommonMarkConverter */
private $converter;
private ?CommonMarkConverter $converter;

public function __construct(Config $config)
{
Expand All @@ -26,7 +24,7 @@ protected function createConverter()

protected function getConverter()
{
if (!$this->converter) {
if (!isset($this->converter)) {
$this->converter = $this->createConverter();
}

Expand Down
39 changes: 17 additions & 22 deletions libs/Daux.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\ContentTypes\ContentTypeHandler;
use Todaymade\Daux\Format\Base\Generator;
use Todaymade\Daux\Tree\Builder;
use Todaymade\Daux\Tree\Root;

Expand All @@ -13,32 +14,27 @@ class Daux

public static $output;

/** @var Tree\Root */
public $tree;
public ?Root $tree;

/** @var Config */
public $config;
public Config $config;

/** @var \Todaymade\Daux\Format\Base\Generator */
protected $generator;
protected Generator $generator;

/** @var ContentTypeHandler */
protected $typeHandler;
protected ContentTypeHandler $typeHandler;

/** @var string[] */
protected $validExtensions;

/** @var Processor */
protected $processor;
protected ?Processor $processor;

/** @var bool */
private $merged_tree = false;
private bool $merged_tree = false;

public function __construct(Config $config, OutputInterface $output)
{
Daux::$output = $output;

$this->config = $config;
$this->tree = null;
}

/**
Expand Down Expand Up @@ -75,7 +71,6 @@ public function getConfig()
if ($this->tree && !$this->merged_tree) {
$this->config->setTree($this->tree);
$this->config->setIndex($this->tree->getIndexPage() ?: $this->tree->getFirstPage());
$entry_page = null;
if ($this->config->isMultilanguage()) {
$entry_page = [];
foreach ($this->config->getLanguages() as $key => $name) {
Expand Down Expand Up @@ -106,7 +101,7 @@ public function getParams()
*/
public function getProcessor()
{
if (!$this->processor) {
if (!isset($this->processor)) {
$this->processor = new Processor($this, Daux::getOutput(), 0);
}

Expand Down Expand Up @@ -138,10 +133,10 @@ public function getGenerators()

/**
* Processor class
*
* You can provide absolute class name or short class name if processor locates in \Todaymade\Daux\Extension namespace.
*
* You can provide absolute class name or short class name if processor locates in \Todaymade\Daux\Extension namespace.
* Location: vendor/daux/daux.io/daux
*
*
* @see \Todaymade\Daux\Extension\Processor
* @example -p \\Todaymade\\Daux\\Extension\\Processor
* @throws \RuntimeException
Expand All @@ -154,15 +149,15 @@ public function getProcessorClass()
if (empty($processor)) {
return null;
}

if (!strstr($processor, "\\")) {
$processor = '\\Todaymade\\Daux\\Extension\\' . $processor;
}

if (!class_exists($processor)) {
throw new \RuntimeException("Class '$processor' not found. We cannot use it as a Processor");
}

if (!array_key_exists('Todaymade\\Daux\\Processor', class_parents($processor))) {
throw new \RuntimeException("Class '$processor' invalid, should extend '\\Todaymade\\Daux\\Processor'");
}
Expand Down Expand Up @@ -190,7 +185,7 @@ protected function findAlternatives($input, $words)
*/
public function getGenerator()
{
if ($this->generator) {
if (isset($this->generator)) {
return $this->generator;
}

Expand Down Expand Up @@ -229,7 +224,7 @@ public function getGenerator()

public function getContentTypeHandler()
{
if ($this->typeHandler) {
if (isset($this->typeHandler)) {
return $this->typeHandler;
}

Expand Down
15 changes: 3 additions & 12 deletions libs/Format/Base/ContentPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@

abstract class ContentPage extends SimplePage
{
/**
* @var Content
*/
protected $file;
protected Content $file;

/**
* @var Config
*/
protected $config;
protected Config $config;

/**
* @var ContentType
*/
protected $contentType;
protected ContentType $contentType;

protected $generatedContent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function daux_loadCSS(url) {

}


protected function doConversion($raw)
{
$content = parent::doConversion($raw);
Expand Down
6 changes: 2 additions & 4 deletions libs/Format/Confluence/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
{
use RunAction;

/** @var string */
protected $prefix;
protected string $prefix;

/** @var Daux */
protected $daux;
protected Daux $daux;

public function __construct(Daux $daux)
{
Expand Down
21 changes: 5 additions & 16 deletions libs/Format/Confluence/Publisher.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
<?php namespace Todaymade\Daux\Format\Confluence;

use GuzzleHttp\Exception\BadResponseException;
use Symfony\Component\Console\Output\OutputInterface;
use Todaymade\Daux\Console\RunAction;

class Publisher
{
use RunAction;

/**
* @var int terminal width
*/
public $width;
public int $width;

/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
public $output;
public OutputInterface $output;

/**
* @var Api
*/
protected $client;
protected Api $client;

/**
* @var Config
*/
protected $confluence;
protected Config $confluence;

/**
* @param $confluence
Expand Down
16 changes: 6 additions & 10 deletions libs/Format/Confluence/PublisherDelete.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<?php namespace Todaymade\Daux\Format\Confluence;

use Symfony\Component\Console\Output\OutputInterface;

class PublisherDelete
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
public $output;
public OutputInterface $output;

/**
* @var array files that can be deleted
*/
protected $deletable;
protected array $deletable;

/**
* @var bool should delete ?
*/
protected $delete;
protected bool $delete;

/**
* @var Api
*/
protected $client;
protected Api $client;

public function __construct($output, bool $delete, $client)
{
Expand Down
16 changes: 4 additions & 12 deletions libs/Format/HTML/ContentPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@

class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
{
/**
* @var Template
*/
public $templateRenderer;
/**
* @var string
*/
private $language;
public Template $templateRenderer;

/**
* @var bool
*/
private $homepage;
private string $language;

private bool $homepage;

private function isHomepage(): bool
{
Expand Down
6 changes: 2 additions & 4 deletions libs/Format/HTML/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
use RunAction;
use HTMLUtils;

/** @var Daux */
protected $daux;
protected Daux $daux;

/** @var Template */
protected $templateRenderer;
protected Template $templateRenderer;

protected $indexed_pages = [];

Expand Down
6 changes: 2 additions & 4 deletions libs/Format/HTMLFile/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
use RunAction;
use HTMLUtils;

/** @var Daux */
protected $daux;
protected Daux $daux;

/** @var Template */
protected $templateRenderer;
protected Template $templateRenderer;

public function __construct(Daux $daux)
{
Expand Down
20 changes: 4 additions & 16 deletions libs/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,13 @@

class Processor
{
/**
* @var Daux
*/
protected $daux;
protected Daux $daux;

/**
* @var OutputInterface
*/
protected $output;
protected OutputInterface $output;

/**
* @var int
*/
protected $width;
protected int $width;

/**
* @param int $width
*/
public function __construct(Daux $daux, OutputInterface $output, $width)
public function __construct(Daux $daux, OutputInterface $output, int $width)
{
$this->daux = $daux;
$this->output = $output;
Expand Down
Loading

0 comments on commit 9c06b12

Please sign in to comment.