web: Augmente le niveau de PHPStan
continuous-integration/drone/push Build is passing Details

pull/51/head
Clément FRÉVILLE 2 years ago
parent bb89ccb243
commit aba51545e6

@ -30,7 +30,7 @@ steps:
image: ghcr.io/phpstan/phpstan:latest-php8.2
commands:
- cd web
- phpstan analyse src --level 2
- phpstan analyse src --level 3
- name: build-book
image: hub.codefirst.iut.uca.fr/clement.freville2/oki-build-image:latest

1
.gitignore vendored

@ -20,7 +20,6 @@ oki-test
third-party
oki-packages
packages
composer.json
composer.lock
composer.phar
vendor/

@ -0,0 +1,18 @@
{
"name": "oki/oki",
"homepage": "https://codefirst.iut.uca.fr/git/oki/oki",
"type": "project",
"autoload": {
"psr-4": {
"Oki\\": "src/Oki"
}
},
"require": {
"php": ">=7.4",
"ext-pdo": "*",
"ext-json": "*"
},
"require-dev": {
"phpstan/phpstan": "^1.9"
}
}

@ -17,7 +17,7 @@
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
@ -38,15 +38,15 @@
*/
class SplClassLoader
{
private $_fileExtension = '.php';
private $_namespace;
private $_includePath;
private $_namespaceSeparator = '\\';
private string $_fileExtension = '.php';
private ?string $_namespace;
private ?string $_includePath;
private string $_namespaceSeparator = '\\';
/**
* Creates a new <tt>SplClassLoader</tt> that loads classes of the
* specified namespace.
*
*
* @param string $ns The namespace to use.
*/
public function __construct(string $ns = null, string $includePath = null)
@ -57,7 +57,7 @@ class SplClassLoader
/**
* Sets the namespace separator used by classes in the namespace of this class loader.
*
*
* @param string $sep The separator to use.
*/
public function setNamespaceSeparator(string $sep)
@ -66,18 +66,18 @@ class SplClassLoader
}
/**
* Gets the namespace seperator used by classes in the namespace of this class loader.
* Gets the namespace separator used by classes in the namespace of this class loader.
*
* @return void
* @return string
*/
public function getNamespaceSeparator()
public function getNamespaceSeparator(): string
{
return $this->_namespaceSeparator;
}
/**
* Sets the base include path for all class files in the namespace of this class loader.
*
*
* @param string $includePath
*/
public function setIncludePath(string $includePath)
@ -90,17 +90,17 @@ class SplClassLoader
*
* @return string $includePath
*/
public function getIncludePath()
public function getIncludePath(): ?string
{
return $this->_includePath;
}
/**
* Sets the file extension of class files in the namespace of this class loader.
*
*
* @param string $fileExtension
*/
public function setFileExtension($fileExtension)
public function setFileExtension(string $fileExtension)
{
$this->_fileExtension = $fileExtension;
}
@ -110,7 +110,7 @@ class SplClassLoader
*
* @return string $fileExtension
*/
public function getFileExtension()
public function getFileExtension(): string
{
return $this->_fileExtension;
}
@ -152,4 +152,4 @@ class SplClassLoader
require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
}
}
}
}

Loading…
Cancel
Save