]> git.andy128k.dev Git - ipf.git/commitdiff
add phan linter and make few fixes
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 26 May 2018 17:25:36 +0000 (19:25 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 26 May 2018 17:25:36 +0000 (19:25 +0200)
17 files changed:
.phan/config.php [new file with mode: 0644]
composer.json
composer.lock
ipf/admin/app.php
ipf/admin/component.php
ipf/admin/controllers/components.php
ipf/admin/controllers/file_browser.php
ipf/admin/form/widgets/orderedsettable.php
ipf/command/pack.php
ipf/form/field/file.php
ipf/form/form.php
ipf/form/layout.php
ipf/format.php
ipf/http/request.php
ipf/middleware/error.php
ipf/pager.php
t/ImageProcessorTest.php

diff --git a/.phan/config.php b/.phan/config.php
new file mode 100644 (file)
index 0000000..98deab2
--- /dev/null
@@ -0,0 +1,300 @@
+<?php
+
+use Phan\Issue;
+
+/**
+ * This configuration file was automatically generated by 'phan --init --init-level=3'
+ *
+ * TODOs (added by 'phan --init'):
+ *
+ * - Go through this file and verify that there are no missing/unnecessary files/directories.
+ *   (E.g. this only includes direct composer dependencies - You may have to manually add indirect composer dependencies to 'directory_list')
+ * - Look at 'plugins' and add or remove plugins if appropriate (see https://github.com/phan/phan/tree/master/.phan/plugins#plugins)
+ * - Add global suppressions for pre-existing issues to suppress_issue_types (https://github.com/phan/phan/wiki/Tutorial-for-Analyzing-a-Large-Sloppy-Code-Base)
+ *
+ * This configuration will be read and overlayed on top of the
+ * default configuration. Command line arguments will be applied
+ * after this file is read.
+ *
+ * @see src/Phan/Config.php
+ * See Config for all configurable options.
+ *
+ * A Note About Paths
+ * ==================
+ *
+ * Files referenced from this file should be defined as
+ *
+ * ```
+ *   Config::projectPath('relative_path/to/file')
+ * ```
+ *
+ * where the relative path is relative to the root of the
+ * project which is defined as either the working directory
+ * of the phan executable or a path passed in via the CLI
+ * '-d' flag.
+ */
+return [
+
+    // Supported values: '7.0', '7.1', '7.2', null.
+    // If this is set to null,
+    // then Phan assumes the PHP version which is closest to the minor version
+    // of the php executable used to execute phan.
+    // TODO: Choose a target_php_version for this project, or leave as null and remove this comment
+    'target_php_version' => NULL,
+
+    // If enabled, missing properties will be created when
+    // they are first seen. If false, we'll report an
+    // error message if there is an attempt to write
+    // to a class property that wasn't explicitly
+    // defined.
+    'allow_missing_properties' => false,
+
+    // If enabled, null can be cast as any type and any
+    // type can be cast to null. Setting this to true
+    // will cut down on false positives.
+    'null_casts_as_any_type' => false,
+
+    // If enabled, allow null to be cast as any array-like type.
+    // This is an incremental step in migrating away from null_casts_as_any_type.
+    // If null_casts_as_any_type is true, this has no effect.
+    'null_casts_as_array' => true,
+
+    // If enabled, allow any array-like type to be cast to null.
+    // This is an incremental step in migrating away from null_casts_as_any_type.
+    // If null_casts_as_any_type is true, this has no effect.
+    'array_casts_as_null' => true,
+
+    // If enabled, scalars (int, float, bool, string, null)
+    // are treated as if they can cast to each other.
+    // This does not affect checks of array keys. See scalar_array_key_cast.
+    'scalar_implicit_cast' => false,
+
+    // If enabled, any scalar array keys (int, string)
+    // are treated as if they can cast to each other.
+    // E.g. array<int,stdClass> can cast to array<string,stdClass> and vice versa.
+    // Normally, a scalar type such as int could only cast to/from int and mixed.
+    'scalar_array_key_cast' => true,
+
+    // If this has entries, scalars (int, float, bool, string, null)
+    // are allowed to perform the casts listed.
+    // E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
+    // allows casting null to a string, but not vice versa.
+    // (subset of scalar_implicit_cast)
+    'scalar_implicit_partial' => [],
+
+    // If true, seemingly undeclared variables in the global
+    // scope will be ignored. This is useful for projects
+    // with complicated cross-file globals that you have no
+    // hope of fixing.
+    'ignore_undeclared_variables_in_global_scope' => true,
+
+    // Set this to false to emit PhanUndeclaredFunction issues for internal functions that Phan has signatures for,
+    // but aren't available in the codebase, or the internal functions used to run phan
+    // (may lead to false positives if an extension isn't loaded)
+    // If this is true(default), then Phan will not warn.
+    'ignore_undeclared_functions_with_known_signatures' => true,
+
+    // Backwards Compatibility Checking. This is slow
+    // and expensive, but you should consider running
+    // it before upgrading your version of PHP to a
+    // new version that has backward compatibility
+    // breaks.
+    'backward_compatibility_checks' => false,
+
+    // If true, check to make sure the return type declared
+    // in the doc-block (if any) matches the return type
+    // declared in the method signature.
+    'check_docblock_signature_return_type_match' => false,
+
+    // (*Requires check_docblock_signature_param_type_match to be true*)
+    // If true, make narrowed types from phpdoc params override
+    // the real types from the signature, when real types exist.
+    // (E.g. allows specifying desired lists of subclasses,
+    //  or to indicate a preference for non-nullable types over nullable types)
+    // Affects analysis of the body of the method and the param types passed in by callers.
+    'prefer_narrowed_phpdoc_param_type' => true,
+
+    // (*Requires check_docblock_signature_return_type_match to be true*)
+    // If true, make narrowed types from phpdoc returns override
+    // the real types from the signature, when real types exist.
+    // (E.g. allows specifying desired lists of subclasses,
+    //  or to indicate a preference for non-nullable types over nullable types)
+    // Affects analysis of return statements in the body of the method and the return types passed in by callers.
+    'prefer_narrowed_phpdoc_return_type' => true,
+
+    // If enabled, check all methods that override a
+    // parent method to make sure its signature is
+    // compatible with the parent's. This check
+    // can add quite a bit of time to the analysis.
+    // This will also check if final methods are overridden, etc.
+    'analyze_signature_compatibility' => true,
+
+    // This setting maps case insensitive strings to union types.
+    // This is useful if a project uses phpdoc that differs from the phpdoc2 standard.
+    // If the corresponding value is the empty string, Phan will ignore that union type (E.g. can ignore 'the' in `@return the value`)
+    // If the corresponding value is not empty, Phan will act as though it saw the corresponding unionTypes(s) when the keys show up in a UnionType of @param, @return, @var, @property, etc.
+    //
+    // This matches the **entire string**, not parts of the string.
+    // (E.g. `@return the|null` will still look for a class with the name `the`, but `@return the` will be ignored with the below setting)
+    //
+    // (These are not aliases, this setting is ignored outside of doc comments).
+    // (Phan does not check if classes with these names exist)
+    //
+    // Example setting: ['unknown' => '', 'number' => 'int|float', 'char' => 'string', 'long' => 'int', 'the' => '']
+    'phpdoc_type_mapping' => [],
+
+    // Set to true in order to attempt to detect dead
+    // (unreferenced) code. Keep in mind that the
+    // results will only be a guess given that classes,
+    // properties, constants and methods can be referenced
+    // as variables (like `$class->$property` or
+    // `$class->$method()`) in ways that we're unable
+    // to make sense of.
+    'dead_code_detection' => false,
+
+    // If true, this run a quick version of checks that takes less
+    // time at the cost of not running as thorough
+    // an analysis. You should consider setting this
+    // to true only when you wish you had more **undiagnosed** issues
+    // to fix in your code base.
+    //
+    // In quick-mode the scanner doesn't rescan a function
+    // or a method's code block every time a call is seen.
+    // This means that the problem here won't be detected:
+    //
+    // ```php
+    // <?php
+    // function test($arg):int {
+    //     return $arg;
+    // }
+    // test("abc");
+    // ```
+    //
+    // This would normally generate:
+    //
+    // ```sh
+    // test.php:3 TypeError return string but `test()` is declared to return int
+    // ```
+    //
+    // The initial scan of the function's code block has no
+    // type information for `$arg`. It isn't until we see
+    // the call and rescan test()'s code block that we can
+    // detect that it is actually returning the passed in
+    // `string` instead of an `int` as declared.
+    'quick_mode' => false,
+
+    // If true, then before analysis, try to simplify AST into a form
+    // which improves Phan's type inference in edge cases.
+    //
+    // This may conflict with 'dead_code_detection'.
+    // When this is true, this slows down analysis slightly.
+    //
+    // E.g. rewrites `if ($a = value() && $a > 0) {...}`
+    // into $a = value(); if ($a) { if ($a > 0) {...}}`
+    'simplify_ast' => true,
+
+    // Enable or disable support for generic templated
+    // class types.
+    'generic_types_enabled' => true,
+
+    // Override to hardcode existence and types of (non-builtin) globals in the global scope.
+    // Class names should be prefixed with '\\'.
+    // (E.g. ['_FOO' => '\\FooClass', 'page' => '\\PageClass', 'userId' => 'int'])
+    'globals_type_map' => [],
+
+    // The minimum severity level to report on. This can be
+    // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
+    // Issue::SEVERITY_CRITICAL. Setting it to only
+    // critical issues is a good place to start on a big
+    // sloppy mature code base.
+    'minimum_severity' => Issue::SEVERITY_LOW,
+
+    // Add any issue types (such as 'PhanUndeclaredMethod')
+    // to this black-list to inhibit them from being reported.
+    'suppress_issue_types' => [],
+
+    // A regular expression to match files to be excluded
+    // from parsing and analysis and will not be read at all.
+    //
+    // This is useful for excluding groups of test or example
+    // directories/files, unanalyzable files, or files that
+    // can't be removed for whatever reason.
+    // (e.g. '@Test\.php$@', or '@vendor/.*/(tests|Tests)/@')
+    'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
+
+    // A file list that defines files that will be excluded
+    // from parsing and analysis and will not be read at all.
+    //
+    // This is useful for excluding hopelessly unanalyzable
+    // files that can't be removed for whatever reason.
+    'exclude_file_list' => [],
+
+    // A directory list that defines files that will be excluded
+    // from static analysis, but whose class and method
+    // information should be included.
+    //
+    // Generally, you'll want to include the directories for
+    // third-party code (such as "vendor/") in this list.
+    //
+    // n.b.: If you'd like to parse but not analyze 3rd
+    //       party code, directories containing that code
+    //       should be added to the `directory_list` as
+    //       to `excluce_analysis_directory_list`.
+    'exclude_analysis_directory_list' => [
+        'vendor/',
+    ],
+
+    // The number of processes to fork off during the analysis
+    // phase.
+    'processes' => 1,
+
+    // List of case-insensitive file extensions supported by Phan.
+    // (e.g. php, html, htm)
+    'analyzed_file_extensions' => [
+        'php',
+    ],
+
+    // You can put paths to stubs of internal extensions in this config option.
+    // If the corresponding extension is **not** loaded, then phan will use the stubs instead.
+    // Phan will continue using its detailed type annotations,
+    // but load the constants, classes, functions, and classes (and their Reflection types)
+    // from these stub files (doubling as valid php files).
+    // Use a different extension from php to avoid accidentally loading these.
+    // The 'tools/make_stubs' script can be used to generate your own stubs (compatible with php 7.0+ right now)
+    'autoload_internal_extension_signatures' => [],
+
+    // A list of plugin files to execute
+    // Plugins which are bundled with Phan can be added here by providing their name (e.g. 'AlwaysReturnPlugin')
+    // Alternately, you can pass in the full path to a PHP file with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php')
+    'plugins' => [
+        'AlwaysReturnPlugin',
+        'PregRegexCheckerPlugin',
+        'UnreachableCodePlugin',
+    ],
+
+    // A list of directories that should be parsed for class and
+    // method information. After excluding the directories
+    // defined in exclude_analysis_directory_list, the remaining
+    // files will be statically analyzed for errors.
+    //
+    // Thus, both first-party and third-party code being used by
+    // your application should be included in this list.
+    'directory_list' => [
+        '.',
+        'vendor/andy128k/ipf-legacy-template/src',
+        'vendor/andy128k/migrations/src',
+        'vendor/andy128k/missing-tools/src',
+        'vendor/andy128k/pegp/src',
+        'vendor/andy128k/routeexpression/src',
+        'vendor/d11wtq/boris/lib',
+        'vendor/doctrine/dbal/lib',
+        'vendor/pear/archive_tar',
+        'vendor/phan/phan/src/Phan',
+        'vendor/phpunit/phpunit/src',
+    ],
+
+    // A list of individual files to include in analysis
+    // with a path relative to the root directory of the
+    // project
+    'file_list' => [],
+];
index 8911269fa595a59f769b0e13ae91502fa3e20f94..c3e92165f8d4285430e431c0d96f3af71fe3ad26 100644 (file)
@@ -27,7 +27,8 @@
     "npm-asset/jquery": "~2",
     "npm-asset/tablednd": "^1.0@dev",
     "npm-asset/tinymce": "^4.7",
-    "npm-asset/flatpickr": "^4.3@dev"
+    "npm-asset/flatpickr": "^4.3@dev",
+    "phan/phan": "dev-master"
   },
   "require-dev": {
     "phpunit/phpunit": "4.4.*"
@@ -43,6 +44,7 @@
   ],
   "minimum-stability": "dev",
   "scripts": {
+    "lint": "phan",
     "test": "phpunit --bootstrap t/project/htdocs/index.php t/"
   }
 }
index 8b21774832815101d99e119bee69915e17f1fd00..917fd0a76c2571740059d8295b6a3b7efa61da6c 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "69fb0e48db3769923764fdf1212a7e24",
+    "content-hash": "199bc0bbf45bae8971384acdd1a3da41",
     "packages": [
         {
             "name": "andy128k/ipf-legacy-template",
             "description": "Route expression",
             "time": "2015-01-11T10:36:51+00:00"
         },
+        {
+            "name": "composer/semver",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/composer/semver.git",
+                "reference": "2b303e43d14d15cc90c8e8db4a1cdb6259f1a5c5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/composer/semver/zipball/2b303e43d14d15cc90c8e8db4a1cdb6259f1a5c5",
+                "reference": "2b303e43d14d15cc90c8e8db4a1cdb6259f1a5c5",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.3.2 || ^7.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.5 || ^5.0.5",
+                "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Composer\\Semver\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nils Adermann",
+                    "email": "naderman@naderman.de",
+                    "homepage": "http://www.naderman.de"
+                },
+                {
+                    "name": "Jordi Boggiano",
+                    "email": "j.boggiano@seld.be",
+                    "homepage": "http://seld.be"
+                },
+                {
+                    "name": "Rob Bast",
+                    "email": "rob.bast@gmail.com",
+                    "homepage": "http://robbast.nl"
+                }
+            ],
+            "description": "Semver library that offers utilities, version constraint parsing and validation.",
+            "keywords": [
+                "semantic",
+                "semver",
+                "validation",
+                "versioning"
+            ],
+            "time": "2017-11-06T09:05:54+00:00"
+        },
+        {
+            "name": "composer/xdebug-handler",
+            "version": "1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/composer/xdebug-handler.git",
+                "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08",
+                "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.3.2 || ^7.0",
+                "psr/log": "^1.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Composer\\XdebugHandler\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "John Stevenson",
+                    "email": "john-stevenson@blueyonder.co.uk"
+                }
+            ],
+            "description": "Restarts a process without xdebug.",
+            "keywords": [
+                "Xdebug",
+                "performance"
+            ],
+            "time": "2018-04-11T15:42:36+00:00"
+        },
         {
             "name": "d11wtq/boris",
             "version": "dev-master",
             ],
             "time": "2018-04-11T05:15:14+00:00"
         },
+        {
+            "name": "felixfbecker/advanced-json-rpc",
+            "version": "v3.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
+                "reference": "29f1d8c2c17f8c04f9768d382b72aeeb0715ebb8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/29f1d8c2c17f8c04f9768d382b72aeeb0715ebb8",
+                "reference": "29f1d8c2c17f8c04f9768d382b72aeeb0715ebb8",
+                "shasum": ""
+            },
+            "require": {
+                "netresearch/jsonmapper": "^1.0",
+                "php": ">=7.0",
+                "phpdocumentor/reflection-docblock": "^4.0.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6.0.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "AdvancedJsonRpc\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "ISC"
+            ],
+            "authors": [
+                {
+                    "name": "Felix Becker",
+                    "email": "felix.b@outlook.com"
+                }
+            ],
+            "description": "A more advanced JSONRPC implementation",
+            "time": "2017-10-28T21:26:16+00:00"
+        },
+        {
+            "name": "microsoft/tolerant-php-parser",
+            "version": "v0.0.11",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Microsoft/tolerant-php-parser.git",
+                "reference": "7647b60b13afd7e929aeef3de2c35696266c4da5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Microsoft/tolerant-php-parser/zipball/7647b60b13afd7e929aeef3de2c35696266c4da5",
+                "reference": "7647b60b13afd7e929aeef3de2c35696266c4da5",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6.4"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Microsoft\\PhpParser\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Rob Lourens",
+                    "email": "roblou@microsoft.com"
+                }
+            ],
+            "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios",
+            "time": "2018-05-12T19:12:14+00:00"
+        },
+        {
+            "name": "netresearch/jsonmapper",
+            "version": "v1.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cweiske/jsonmapper.git",
+                "reference": "3868fe1128ce1169228acdb623359dca74db5ef3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/3868fe1128ce1169228acdb623359dca74db5ef3",
+                "reference": "3868fe1128ce1169228acdb623359dca74db5ef3",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4",
+                "squizlabs/php_codesniffer": "~1.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "JsonMapper": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "OSL-3.0"
+            ],
+            "authors": [
+                {
+                    "name": "Christian Weiske",
+                    "email": "cweiske@cweiske.de",
+                    "homepage": "http://github.com/cweiske/jsonmapper/",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Map nested JSON structures onto PHP classes",
+            "time": "2017-11-28T21:30:01+00:00"
+        },
         {
             "name": "npm-asset/flatpickr",
             "version": "4.4.4",
                 "exception"
             ],
             "time": "2015-02-10T20:07:52+00:00"
+        },
+        {
+            "name": "phan/phan",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phan/phan.git",
+                "reference": "d35e2df4bb1ec5e77f673867a964d142fe2150f9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phan/phan/zipball/d35e2df4bb1ec5e77f673867a964d142fe2150f9",
+                "reference": "d35e2df4bb1ec5e77f673867a964d142fe2150f9",
+                "shasum": ""
+            },
+            "require": {
+                "composer/semver": "^1.4",
+                "composer/xdebug-handler": "^1.0",
+                "ext-ast": "^0.1.5",
+                "felixfbecker/advanced-json-rpc": "^3.0",
+                "microsoft/tolerant-php-parser": "0.0.11",
+                "php": "^7.0.0",
+                "sabre/event": "^5.0",
+                "symfony/console": "^2.3|^3.0|~4.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^6.3.0"
+            },
+            "bin": [
+                "phan",
+                "phan_client",
+                "tocheckstyle"
+            ],
+            "type": "project",
+            "autoload": {
+                "psr-4": {
+                    "Phan\\": "src/Phan"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Rasmus Lerdorf"
+                },
+                {
+                    "name": "Andrew S. Morrison"
+                },
+                {
+                    "name": "Tyson Andre"
+                }
+            ],
+            "description": "A static analyzer for PHP",
+            "keywords": [
+                "analyzer",
+                "php",
+                "static"
+            ],
+            "time": "2018-05-25T15:39:17+00:00"
+        },
+        {
+            "name": "phpdocumentor/reflection-common",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+                "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+                "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.5"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.6"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "phpDocumentor\\Reflection\\": [
+                        "src"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Jaap van Otterdijk",
+                    "email": "opensource@ijaap.nl"
+                }
+            ],
+            "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+            "homepage": "http://www.phpdoc.org",
+            "keywords": [
+                "FQSEN",
+                "phpDocumentor",
+                "phpdoc",
+                "reflection",
+                "static analysis"
+            ],
+            "time": "2017-09-11T18:02:19+00:00"
+        },
+        {
+            "name": "phpdocumentor/reflection-docblock",
+            "version": "4.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+                "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
+                "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0",
+                "phpdocumentor/reflection-common": "^1.0.0",
+                "phpdocumentor/type-resolver": "^0.4.0",
+                "webmozart/assert": "^1.0"
+            },
+            "require-dev": {
+                "doctrine/instantiator": "~1.0.5",
+                "mockery/mockery": "^1.0",
+                "phpunit/phpunit": "^6.4"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "phpDocumentor\\Reflection\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mike van Riel",
+                    "email": "me@mikevanriel.com"
+                }
+            ],
+            "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+            "time": "2017-11-30T07:14:17+00:00"
+        },
+        {
+            "name": "phpdocumentor/type-resolver",
+            "version": "0.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpDocumentor/TypeResolver.git",
+                "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
+                "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.5 || ^7.0",
+                "phpdocumentor/reflection-common": "^1.0"
+            },
+            "require-dev": {
+                "mockery/mockery": "^0.9.4",
+                "phpunit/phpunit": "^5.2||^4.8.24"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "phpDocumentor\\Reflection\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mike van Riel",
+                    "email": "me@mikevanriel.com"
+                }
+            ],
+            "time": "2017-07-14T14:27:02+00:00"
+        },
+        {
+            "name": "psr/log",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/log.git",
+                "reference": "3490ba5925e6dcbe6de950c5c6b8dce9f6e96eda"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/3490ba5925e6dcbe6de950c5c6b8dce9f6e96eda",
+                "reference": "3490ba5925e6dcbe6de950c5c6b8dce9f6e96eda",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Log\\": "Psr/Log/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for logging libraries",
+            "homepage": "https://github.com/php-fig/log",
+            "keywords": [
+                "log",
+                "psr",
+                "psr-3"
+            ],
+            "time": "2018-04-03T15:59:15+00:00"
+        },
+        {
+            "name": "sabre/event",
+            "version": "5.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sabre-io/event.git",
+                "reference": "f5cf802d240df1257866d8813282b98aee3bc548"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sabre-io/event/zipball/f5cf802d240df1257866d8813282b98aee3bc548",
+                "reference": "f5cf802d240df1257866d8813282b98aee3bc548",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": ">=6",
+                "sabre/cs": "~1.0.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Sabre\\Event\\": "lib/"
+                },
+                "files": [
+                    "lib/coroutine.php",
+                    "lib/Loop/functions.php",
+                    "lib/Promise/functions.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Evert Pot",
+                    "email": "me@evertpot.com",
+                    "homepage": "http://evertpot.com/",
+                    "role": "Developer"
+                }
+            ],
+            "description": "sabre/event is a library for lightweight event-based programming",
+            "homepage": "http://sabre.io/event/",
+            "keywords": [
+                "EventEmitter",
+                "async",
+                "coroutine",
+                "eventloop",
+                "events",
+                "hooks",
+                "plugin",
+                "promise",
+                "reactor",
+                "signal"
+            ],
+            "time": "2018-03-05T13:55:47+00:00"
+        },
+        {
+            "name": "symfony/console",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/console.git",
+                "reference": "04173e19f71445fa9eada6db05f242b57c5b849b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/console/zipball/04173e19f71445fa9eada6db05f242b57c5b849b",
+                "reference": "04173e19f71445fa9eada6db05f242b57c5b849b",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1.3",
+                "symfony/polyfill-mbstring": "~1.0"
+            },
+            "conflict": {
+                "symfony/dependency-injection": "<3.4",
+                "symfony/process": "<3.3"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "~3.4|~4.0",
+                "symfony/dependency-injection": "~3.4|~4.0",
+                "symfony/event-dispatcher": "~3.4|~4.0",
+                "symfony/lock": "~3.4|~4.0",
+                "symfony/process": "~3.4|~4.0"
+            },
+            "suggest": {
+                "psr/log-implementation": "For using the console logger",
+                "symfony/event-dispatcher": "",
+                "symfony/lock": "",
+                "symfony/process": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.2-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Console\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Console Component",
+            "homepage": "https://symfony.com",
+            "time": "2018-05-16T14:42:13+00:00"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.8-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for the Mbstring extension",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "mbstring",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "time": "2018-04-26T10:06:28+00:00"
+        },
+        {
+            "name": "webmozart/assert",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/webmozart/assert.git",
+                "reference": "1fc2d96ee97d5052f44662563587a0213895343d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/webmozart/assert/zipball/1fc2d96ee97d5052f44662563587a0213895343d",
+                "reference": "1fc2d96ee97d5052f44662563587a0213895343d",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.3.3 || ^7.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.6",
+                "sebastian/version": "^1.0.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Webmozart\\Assert\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@gmail.com"
+                }
+            ],
+            "description": "Assertions to validate method input/output with nice error messages.",
+            "keywords": [
+                "assert",
+                "check",
+                "validate"
+            ],
+            "time": "2018-05-26T14:16:30+00:00"
         }
     ],
     "packages-dev": [
         "andy128k/routeexpression": 20,
         "andy128k/ipf-legacy-template": 20,
         "npm-asset/tablednd": 20,
-        "npm-asset/flatpickr": 20
+        "npm-asset/flatpickr": 20,
+        "phan/phan": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,
index 28090c119f2046c1facc8044bcf5d5b565dd137c..c64567df1dda6bef1cfe86abd1184930c396146b 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
 use \PFF\Functions as F;
-use \PFF\Placeholder as P;
 
 class IPF_Admin_App extends IPF_Application
 {
index fd52693a976bed8168e46949fa318d6d7eb9c33a..4d32842cc560acbe70c17347d043c2c25d594abc 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use \PFF\Functions as F;
+use \PFF\Placeholder as P;
 use \PFF\HtmlBuilder\Tag as Tag;
 
 interface IPF_Admin_ListFilter
index c4a552975b9750d56a2c744f5e04115a7f452433..86b0e5da9d66f100884726a713177dc6e3af1653 100644 (file)
@@ -43,7 +43,7 @@ class IPF_Admin_Components_Controller extends IPF_Admin_Base_Controller
         $this->checkPermissions('view', 'change');
 
         if (!isset($this->request->POST['ids']) || !is_array($this->request->POST['ids']))
-            return new IPF_HTTP_Response_NotFound($request);
+            return new IPF_HTTP_Response_NotFound($this->request);
 
         if ($this->component->reorder($this->request->POST['ids']))
             return new IPF_HTTP_Response_Json("Ok");
@@ -53,6 +53,9 @@ class IPF_Admin_Components_Controller extends IPF_Admin_Base_Controller
 
     // protected
 
+    /** @var IPF_Admin_Component */
+    protected $component;
+
     protected function before($action)
     {
         $this->ensureUserIsStaff();
index 0b3d6e1f7c2289a74b0592a5cbc98e8b67a6aae4..5fad612988cedd28c34fb5e80d4212e98c2b5602 100644 (file)
@@ -31,6 +31,15 @@ class IPF_Admin_FileBrowser_Controller extends IPF_Admin_Base_Controller
         return $dirtree;
     }
 
+    /** @var string */
+    protected $root;
+
+    /** @var string */
+    protected $dir;
+
+    /** @var string */
+    protected $relative;
+
     protected function setRoot()
     {
         $this->root = realpath(IPF::getUploadPath()) . DIRECTORY_SEPARATOR;
index e217dcb36691ff344f09d79ddc93c8020b669033..92cab7d6112920622ff86cbe33438a09ee0be509 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-use \PFF\HtmlBuilder\Tag as Tag;
-
 class IPF_Admin_Form_Widget_OrderedSetTable extends IPF_Form_Widget_SetTable
 {
     public $orderBy;
index b2492cb36ab052c59f4e3e2761e73ac11530415d..39f7f10d9924fbc8ce1fb6afc510ff5ee575b87b 100644 (file)
@@ -15,7 +15,7 @@ class IPF_Command_Pack
             chdir($uploadsDir . '/..');
             $tar_object = new Archive_Tar($workingDirectory . '/upload.tar');
             $tar_object->setErrorHandling(PEAR_ERROR_PRINT);
-            $tar_object->create('upload');
+            $tar_object->create(['upload']);
             chdir($workingDirectory);
         }
 
@@ -26,7 +26,7 @@ class IPF_Command_Pack
 
         $tar_object = new Archive_Tar($outputFileName);
         $tar_object->setErrorHandling(PEAR_ERROR_PRINT);
-        $tar_object->create('upload.tar dump.sql');
+        $tar_object->create(['upload.tar', 'dump.sql']);
 
         IPF_Shell::unlink('upload.tar');
         IPF_Shell::unlink('dump.sql');
index 18cac3369de55bf191a4f8b49f1f1f2fe28fe693..b1812cf5043a1076fd412ae7d72ba0816d28c691 100644 (file)
@@ -67,20 +67,15 @@ class IPF_Form_Field_File extends IPF_Form_Field
             case UPLOAD_ERR_INI_SIZE:
             case UPLOAD_ERR_FORM_SIZE:
                 throw new IPF_Exception_Form(__('The uploaded file is too large. Reduce the size of the file and send it again.'));
-                break;
             case UPLOAD_ERR_PARTIAL:
                 throw new IPF_Exception_Form(__('The upload did not complete. Please try to send the file again.'));
-                break;
             case UPLOAD_ERR_NO_FILE:
                 throw new IPF_Exception_Form(__('No files were uploaded. Please try to send the file again.'));
-                break;
             case UPLOAD_ERR_NO_TMP_DIR:
             case UPLOAD_ERR_CANT_WRITE:
                 throw new IPF_Exception_Form(__('The server has no temporary folder correctly configured to store the uploaded file.'));
-                break;
             case UPLOAD_ERR_EXTENSION:
                 throw new IPF_Exception_Form(__('The uploaded file has been stopped by an extension.'));
-                break;
             default:
                 throw new IPF_Exception_Form(__('An error occured when upload the file. Please try to send the file again.'));
         }
index 315ba30ec494719f416787cb37c3877cf9108ef9..9a20c83beb24f22ab69ee45d36e3dee789fc48f6 100644 (file)
@@ -93,7 +93,7 @@ abstract class IPF_Form implements Iterator
 
         if (!($error instanceof IPF_Form_Error)) {
             if ($error instanceof \Exception)
-                $error = $this->getMessage();
+                $error = $error->getMessage();
             $error = new IPF_Form_Error((string)$error);
         }
 
index 536eee21e75491e322783f641f4df250769ddbce..1664ae764edbd852ed1aea7334ed31fb075eddb1 100644 (file)
@@ -124,7 +124,7 @@ class IPF_Form_ListLayout extends IPF_Form_LayoutAdapter
 
     public function endForm($form)
     {
-        $deferred = $this->deferred();
+        $deferred = $this->takeDeferred();
         if ($deferred)
             return Tag::li()->raw($deferred);
         else
@@ -144,7 +144,7 @@ class IPF_Form_TableLayout extends IPF_Form_LayoutAdapter
             return Tag::tr(null,
                 Tag::td()->attr('colspan', 2)
                     ->raw($this->errorList($errors))
-                    ->raw($this->deferred()));
+                    ->raw($this->takeDeferred()));
         else
             return '';
     }
index 0a7b29fc34807eb6813a88828380d3f9870b85b0..fc14808e8d04831f9fa0621f02dd33e7cdf76eca 100644 (file)
@@ -98,8 +98,8 @@ final class IPF_Format
     /**
      * Builds format string corresponding to given flags and controls.
      *
-     * @param  integer Format flags
-     * @param  array Format values.
+     * @param integer $flags Format flags
+     * @param array $controls Format values.
      *    Examples:
      *      array(
      *        'Y', // year
index d6395eb0b561ab37864e542838edc38e93c5bedc..d946710840f1a2064f49ec6f8fb91abfe8898111 100644 (file)
@@ -15,6 +15,7 @@ class IPF_HTTP_Request
     public $http_host = '';
     public $SERVER = array();
     public $is_secure = false;
+    public $path_info;
 
     public function __construct()
     {
index 436481f5d2b3d9ce3ad14df57deac35aa664eaf5..01b3832b3448cb035c04cf79722a82296fa8a80a 100644 (file)
@@ -2,6 +2,8 @@
 
 class IPF_Error_Middleware extends IPF_Middleware
 {
+    private $previous_error_handler;
+
     function call($request)
     {
         $this->previous_error_handler = set_error_handler(array($this, 'error_handler'));
@@ -19,7 +21,7 @@ class IPF_Error_Middleware extends IPF_Middleware
             $response = new IPF_HTTP_Response_ServerError($request, $exception);
         }
         if ($this->previous_error_handler)
-            set_error_handler($previous);
+            set_error_handler($this->previous_error_handler);
         else
             restore_error_handler();
         return $response;
index 3f50ef72ee631222d44656a26a9b4d481e886241..161e02305c9501e2f348d9c04effb029bcc0d17d 100644 (file)
@@ -51,7 +51,7 @@ class IPF_Pager_Layout
 
             return $result;
         } else {
-            return array_merge($result, $range);
+            return $range;
         }
     }
 
index 22f81f085b5589ab16e7a2b096e5fcf5fc2bfc3b..6b2076a87992ebb4c7512f76bb201fdaaed6a9cb 100644 (file)
@@ -2,6 +2,9 @@
 
 class Image_Processor_Test extends PHPUnit_Framework_TestCase
 {
+    /** @var string */
+    private $root;
+
     protected function setUp()
     {
         $this->root = IPF::getUploadPath();