Page MenuHomePhabricator

D645.diff
No OneTemporary

D645.diff

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@
*.sublime-project
*.sublime-workspace
-/nbproject/private/
\ No newline at end of file
+/nbproject/private/
+/vendor/
diff --git a/bin/tests/autoload/NamespacedclasslocatorTest.php b/bin/tests/autoload/NamespacedclasslocatorTest.php
deleted file mode 100644
--- a/bin/tests/autoload/NamespacedclasslocatorTest.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php namespace tests\spitfire\core\autoload;
-
-use spitfire\autoload\NamespacedClassLocator;
-
-class NamespacedclasslocatorTest extends \PHPUnit_Framework_TestCase
-{
-
- private $locator;
-
- public function testLookingForControllers() {
- $locator = new NamespacedClassLocator('', spitfire()->getCWD() . '/bin/controllers', 'Controller');
-
- $this->assertNotEquals(false, $locator->getFilenameFor('HomeController'),
- 'The class Locator in spitfire should find the home controller.');
- }
-
-}
\ No newline at end of file
diff --git a/bin/tests/phpunit.xml b/bin/tests/phpunit.xml
deleted file mode 100644
--- a/bin/tests/phpunit.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<phpunit
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
- backupGlobals="true"
- backupStaticAttributes="false"
- cacheTokens="false"
- colors="false"
- convertErrorsToExceptions="false"
- convertNoticesToExceptions="false"
- convertWarningsToExceptions="false"
- forceCoversAnnotation="false"
- mapTestClassNameToCoveredClassName="false"
- printerClass="PHPUnit_TextUI_ResultPrinter"
- processIsolation="false"
- stopOnError="false"
- stopOnFailure="false"
- stopOnIncomplete="false"
- stopOnSkipped="false"
- stopOnRisky="false"
- testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
- timeoutForSmallTests="1"
- timeoutForMediumTests="10"
- timeoutForLargeTests="60"
- bootstrap="../../spitfire/bootstrap.php"
- verbose="false">
- <filter>
- <whitelist processUncoveredFilesFromWhitelist="false">
- <directory suffix=".php">.</directory>
- <exclude>
- <directory suffix=".php">tests</directory>
- </exclude>
- </whitelist>
- </filter>
- <logging>
- <log type="coverage-clover" target="/tmp/coverage.xml"/>
- </logging>
-</phpunit>
\ No newline at end of file
diff --git a/composer.json b/composer.json
new file mode 100644
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "magic3w/permission",
+ "description": "Role based permission server for microservice networks",
+ "type": "project",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "César de la Cal Bretschneider",
+ "email": "cesar@magic3w.com"
+ }
+ ],
+ "minimum-stability": "dev",
+ "prefer-stable": true,
+ "scripts" : {
+ "test" : [
+ "./vendor/bin/phpstan analyse bin --level 5"
+ ],
+ "baseline" : [
+ "./vendor/bin/phpstan analyse bin --level 5 --generate-baseline"
+ ]
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^0.12.82"
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,79 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "1a62ed024b49aa89bd7ac75c6a1459e1",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "phpstan/phpstan",
+ "version": "0.12.82",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "3920f0fb0aff39263d3a4cb0bca120a67a1a6a11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3920f0fb0aff39263d3a4cb0bca120a67a1a6a11",
+ "reference": "3920f0fb0aff39263d3a4cb0bca120a67a1a6a11",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.12-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "support": {
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "source": "https://github.com/phpstan/phpstan/tree/0.12.82"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/phpstan",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-03-19T06:08:17+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "dev",
+ "stability-flags": [],
+ "prefer-stable": true,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "plugin-api-version": "2.0.0"
+}
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
new file mode 100644
--- /dev/null
+++ b/phpstan-baseline.neon
@@ -0,0 +1,342 @@
+parameters:
+ ignoreErrors:
+ -
+ message: "#^Property BaseController\\:\\:\\$sso \\(auth\\\\SSO\\) does not accept auth\\\\SSOCache\\.$#"
+ count: 1
+ path: bin/classes/BaseController.php
+
+ -
+ message: "#^Call to an undefined method auth\\\\SSOCache\\:\\:authApp\\(\\)\\.$#"
+ count: 1
+ path: bin/classes/BaseController.php
+
+ -
+ message: "#^Variable \\$signatures might not be defined\\.$#"
+ count: 1
+ path: bin/classes/auth/AppAuthentication.php
+
+ -
+ message: "#^Call to method getPath\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Call to method getPort\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Call to method getProtocol\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Call to method getServer\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Call to method getUser\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Call to method getPassword\\(\\) on an unknown class auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Instanceof between string\\|null and auth\\\\Token will always evaluate to false\\.$#"
+ count: 1
+ path: bin/classes/auth/SSO.php
+
+ -
+ message: "#^Variable \\$http_response_header in isset\\(\\) always exists and is not nullable\\.$#"
+ count: 1
+ path: bin/classes/auth/Token.php
+
+ -
+ message: "#^Parameter \\$url of method auth\\\\URLReflection\\:\\:fromURL\\(\\) has invalid typehint type auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/URLReflection.php
+
+ -
+ message: "#^Return typehint of method auth\\\\URLReflection\\:\\:fromURL\\(\\) has invalid type auth\\\\Settings\\.$#"
+ count: 1
+ path: bin/classes/auth/URLReflection.php
+
+ -
+ message: "#^Class auth\\\\URLReflection constructor invoked with 8 parameters, 7 required\\.$#"
+ count: 1
+ path: bin/classes/auth/URLReflection.php
+
+ -
+ message: "#^Negated boolean expression is always true\\.$#"
+ count: 1
+ path: bin/classes/signature/Signature.php
+
+ -
+ message: "#^Result of \\|\\| is always true\\.$#"
+ count: 1
+ path: bin/classes/signature/Signature.php
+
+ -
+ message: "#^Parameter \\#5 \\$context of class signature\\\\Signature constructor expects string, array\\<int, string\\> given\\.$#"
+ count: 1
+ path: bin/classes/signature/Signature.php
+
+ -
+ message: "#^Parameter \\#7 \\$salt of class signature\\\\Signature constructor expects string\\|null, signature\\\\Checksum given\\.$#"
+ count: 1
+ path: bin/classes/signature/Signature.php
+
+ -
+ message: "#^Result of && is always true\\.$#"
+ count: 3
+ path: bin/controllers/grant.php
+
+ -
+ message: "#^Unreachable statement \\- code above always terminates\\.$#"
+ count: 3
+ path: bin/controllers/grant.php
+
+ -
+ message: "#^Access to an undefined property ResourceModel\\:\\:\\$_id\\.$#"
+ count: 2
+ path: bin/controllers/grant.php
+
+ -
+ message: "#^Static call to instance method permission\\\\PermissionHelper\\:\\:unlockAll\\(\\)\\.$#"
+ count: 1
+ path: bin/controllers/grant.php
+
+ -
+ message: "#^Negated boolean expression is always false\\.$#"
+ count: 1
+ path: bin/controllers/identity.php
+
+ -
+ message: "#^Class publicException referenced with incorrect case\\: PublicException\\.$#"
+ count: 1
+ path: bin/controllers/identity.php
+
+ -
+ message: "#^PHPDoc tag @param references unknown parameter\\: \\$resource$#"
+ count: 1
+ path: bin/controllers/mnemonic/identity.php
+
+ -
+ message: "#^Right side of && is always true\\.$#"
+ count: 4
+ path: bin/controllers/mnemonic/identity.php
+
+ -
+ message: "#^Access to an undefined property IdentityModel\\:\\:\\$_id\\.$#"
+ count: 4
+ path: bin/controllers/mnemonic/identity.php
+
+ -
+ message: "#^Access to an undefined property mnemonic\\\\IdentityController\\:\\:\\$validation\\.$#"
+ count: 2
+ path: bin/controllers/mnemonic/identity.php
+
+ -
+ message: "#^Right side of && is always true\\.$#"
+ count: 4
+ path: bin/controllers/mnemonic/resource.php
+
+ -
+ message: "#^Access to an undefined property ResourceModel\\:\\:\\$_id\\.$#"
+ count: 4
+ path: bin/controllers/mnemonic/resource.php
+
+ -
+ message: "#^Access to an undefined property mnemonic\\\\ResourceController\\:\\:\\$validation\\.$#"
+ count: 2
+ path: bin/controllers/mnemonic/resource.php
+
+ -
+ message: "#^Unreachable statement \\- code above always terminates\\.$#"
+ count: 1
+ path: bin/controllers/resource.php
+
+ -
+ message: "#^Negated boolean expression is always false\\.$#"
+ count: 1
+ path: bin/controllers/resource.php
+
+ -
+ message: "#^Access to an undefined property ResourceModel\\:\\:\\$removed\\.$#"
+ count: 1
+ path: bin/controllers/resource.php
+
+ -
+ message: "#^Negated boolean expression is always false\\.$#"
+ count: 1
+ path: bin/controllers/setup.php
+
+ -
+ message: "#^Access to undefined constant GrantModel\\:\\:GRANT_ALOW\\.$#"
+ count: 1
+ path: bin/directors/grant.php
+
+ -
+ message: "#^Access to an undefined property ImportDirector\\:\\:\\$parameters\\.$#"
+ count: 1
+ path: bin/directors/import.php
+
+ -
+ message: "#^Variable \\$allow might not be defined\\.$#"
+ count: 2
+ path: bin/directors/import.php
+
+ -
+ message: "#^Variable \\$message might not be defined\\.$#"
+ count: 1
+ path: bin/error_pages/500.php
+
+ -
+ message: "#^Variable \\$moreInfo might not be defined\\.$#"
+ count: 1
+ path: bin/error_pages/500.php
+
+ -
+ message: "#^Variable \\$message might not be defined\\.$#"
+ count: 1
+ path: bin/error_pages/default.php
+
+ -
+ message: "#^Variable \\$moreInfo might not be defined\\.$#"
+ count: 1
+ path: bin/error_pages/default.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$appid\\.$#"
+ count: 1
+ path: bin/models/application.php
+
+ -
+ message: "#^Access to private property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$name\\.$#"
+ count: 1
+ path: bin/models/application.php
+
+ -
+ message: "#^Method ApplicationModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/application.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$resource\\.$#"
+ count: 1
+ path: bin/models/grant.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$identity\\.$#"
+ count: 1
+ path: bin/models/grant.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$grant\\.$#"
+ count: 1
+ path: bin/models/grant.php
+
+ -
+ message: "#^Method GrantModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/grant.php
+
+ -
+ message: "#^Access to private property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$name\\.$#"
+ count: 1
+ path: bin/models/identity.php
+
+ -
+ message: "#^Method IdentityModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/identity.php
+
+ -
+ message: "#^Access to an undefined property IdentityModel\\:\\:\\$_id\\.$#"
+ count: 1
+ path: bin/models/identity.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$event\\.$#"
+ count: 1
+ path: bin/models/log.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$blame\\.$#"
+ count: 1
+ path: bin/models/log.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$created\\.$#"
+ count: 1
+ path: bin/models/log.php
+
+ -
+ message: "#^Method LogModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/log.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$type\\.$#"
+ count: 1
+ path: bin/models/mnemonic.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$id\\.$#"
+ count: 1
+ path: bin/models/mnemonic.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$caption\\.$#"
+ count: 1
+ path: bin/models/mnemonic.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$description\\.$#"
+ count: 1
+ path: bin/models/mnemonic.php
+
+ -
+ message: "#^Method MnemonicModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/mnemonic.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$parent\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$key\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$record\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^Access to an undefined property spitfire\\\\storage\\\\database\\\\Schema\\:\\:\\$removed\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^Method ResourceModel\\:\\:definitions\\(\\) should return spitfire\\\\storage\\\\database\\\\Schema but return statement is missing\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^Access to an undefined property ResourceModel\\:\\:\\$_id\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
+ -
+ message: "#^If condition is always true\\.$#"
+ count: 1
+ path: bin/models/resource.php
+
diff --git a/phpstan.neon b/phpstan.neon
new file mode 100644
--- /dev/null
+++ b/phpstan.neon
@@ -0,0 +1,8 @@
+parameters:
+ scanDirectories:
+ - spitfire/
+ excludePaths:
+ analyse:
+ - bin/templates
+includes:
+ - phpstan-baseline.neon
\ No newline at end of file

File Metadata

Mime Type
text/plain
Expires
Apr 12 2021, 3:12 PM (9 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6101
Default Alt Text
D645.diff (16 KB)

Event Timeline