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 image: ghcr.io/phpstan/phpstan:latest-php8.2
commands: commands:
- cd web - cd web
- phpstan analyse src --level 2 - phpstan analyse src --level 3
- name: build-book - name: build-book
image: hub.codefirst.iut.uca.fr/clement.freville2/oki-build-image:latest image: hub.codefirst.iut.uca.fr/clement.freville2/oki-build-image:latest

1
.gitignore vendored

@ -20,7 +20,6 @@ oki-test
third-party third-party
oki-packages oki-packages
packages packages
composer.json
composer.lock composer.lock
composer.phar composer.phar
vendor/ 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"
}
}

@ -38,10 +38,10 @@
*/ */
class SplClassLoader class SplClassLoader
{ {
private $_fileExtension = '.php'; private string $_fileExtension = '.php';
private $_namespace; private ?string $_namespace;
private $_includePath; private ?string $_includePath;
private $_namespaceSeparator = '\\'; private string $_namespaceSeparator = '\\';
/** /**
* Creates a new <tt>SplClassLoader</tt> that loads classes of the * Creates a new <tt>SplClassLoader</tt> that loads classes of the
@ -66,11 +66,11 @@ 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; return $this->_namespaceSeparator;
} }
@ -90,7 +90,7 @@ class SplClassLoader
* *
* @return string $includePath * @return string $includePath
*/ */
public function getIncludePath() public function getIncludePath(): ?string
{ {
return $this->_includePath; return $this->_includePath;
} }
@ -100,7 +100,7 @@ class SplClassLoader
* *
* @param string $fileExtension * @param string $fileExtension
*/ */
public function setFileExtension($fileExtension) public function setFileExtension(string $fileExtension)
{ {
$this->_fileExtension = $fileExtension; $this->_fileExtension = $fileExtension;
} }
@ -110,7 +110,7 @@ class SplClassLoader
* *
* @return string $fileExtension * @return string $fileExtension
*/ */
public function getFileExtension() public function getFileExtension(): string
{ {
return $this->_fileExtension; return $this->_fileExtension;
} }

Loading…
Cancel
Save