├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── phpstan ├── phpstan.phar └── src ├── .gitignore ├── bin └── phpstan └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /composer.lock 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ondřej Mirtes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phpstan/phpstan-shim 2 | 3 | **Thank you for using PHPStan!** 4 | 5 | With the release of **PHPStan 0.12**, the primary Composer package used by most users, 6 | `phpstan/phpstan`, has switched to a PHAR file. It works the same way as `phpstan-shim`. 7 | The need for a separate PHAR distribution has ceased. 8 | Package `phpstan/phpstan-shim` is no longer needed. 9 | 10 | You should upgrade to `phpstan/phpstan` 0.12 with the following steps: 11 | 12 | 1) In your composer.json, rewrite line with `"phpstan/phpstan-shim"` 13 | to `"phpstan/phpstan": "^0.12"`. 14 | 2) Delete your `composer.lock`. 15 | 3) Delete `vendor/phpstan` directory. 16 | 4) Delete `vendor/bin/phpstan` and `vendor/bin/phpstan.phar`. 17 | 5) Run composer install. 18 | 19 | If you have any problem upgrading, don't hesitate to describe your issue at: 20 | https://github.com/phpstan/phpstan/issues/new/choose 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpstan/phpstan-shim", 3 | "description": "PHPStan PHAR distribution - deprecated", 4 | "license": ["MIT"], 5 | "require": { 6 | "php": "~7.1" 7 | }, 8 | "bin": [ 9 | "phpstan", 10 | "phpstan.phar" 11 | ], 12 | "extra": { 13 | "branch-alias": { 14 | "dev-master": "0.12-dev" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /phpstan: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpstan/phpstan-shim/f2b69bdaaa7b0021bd79a5233db9abb3242c0522/phpstan -------------------------------------------------------------------------------- /phpstan.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpstan/phpstan-shim/f2b69bdaaa7b0021bd79a5233db9abb3242c0522/phpstan.phar -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /composer.lock 3 | -------------------------------------------------------------------------------- /src/bin/phpstan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setName('analyse') 17 | ->setDescription('Analyses source code') 18 | ->setDefinition([ 19 | new InputArgument('paths', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Paths with source code to run analysis on'), 20 | new InputOption('paths-file', null, InputOption::VALUE_REQUIRED, 'Path to a file with a list of paths to run analysis on'), 21 | new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'), 22 | new InputOption('level', 'l', InputOption::VALUE_REQUIRED, 'Level of rule options - the higher the stricter'), 23 | new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not show progress bar, only results'), 24 | new InputOption('debug', null, InputOption::VALUE_NONE, 'Show debug information - which file is analysed, do not catch internal errors'), 25 | new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'), 26 | new InputOption('error-format', null, InputOption::VALUE_REQUIRED, 'Format in which to print the result of the analysis', 'table'), 27 | new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for analysis'), 28 | new InputOption('xdebug', null, InputOption::VALUE_NONE, 'Allow running with XDebug for debugging purposes'), 29 | ]); 30 | } 31 | 32 | /** 33 | * @return string[] 34 | */ 35 | public function getAliases(): array 36 | { 37 | return ['analyze']; 38 | } 39 | 40 | protected function execute(InputInterface $input, OutputInterface $output) 41 | { 42 | $output->writeln(''); 43 | $output->writeln('Thank you for using PHPStan!'); 44 | $output->writeln(''); 45 | $output->writeln('With the release of PHPStan 0.12, the primary Composer package used by most users,'); 46 | $output->writeln('phpstan/phpstan, has switched to a PHAR file. It works the same way as phpstan-shim.'); 47 | 48 | $output->writeln('The need for a separate PHAR distribution has ceased.'); 49 | $output->writeln('Package phpstan/phpstan-shim is no longer needed.'); 50 | $output->writeln(''); 51 | $output->writeln('You should upgrade to phpstan/phpstan 0.12 with the following steps:'); 52 | 53 | $output->writeln('1) In your composer.json, rewrite line with "phpstan/phpstan-shim"'); 54 | $output->writeln(' to "phpstan/phpstan": "^0.12".'); 55 | $output->writeln('2) Delete your composer.lock.'); 56 | $output->writeln('3) Delete vendor/phpstan directory.'); 57 | $output->writeln('4) Delete vendor/bin/phpstan and vendor/bin/phpstan.phar.'); 58 | $output->writeln('5) Run composer install.'); 59 | 60 | $output->writeln(''); 61 | $output->writeln('If you have any problem upgrading, don\'t hesitate to describe your issue at:'); 62 | 63 | $output->writeln('https://github.com/phpstan/phpstan/issues/new/choose'); 64 | $output->writeln(''); 65 | 66 | return 1; 67 | } 68 | 69 | }; 70 | 71 | $application = new \Symfony\Component\Console\Application(); 72 | $application->add($command); 73 | $application->setDefaultCommand('analyse', true); 74 | $application->run(); 75 | 76 | })(); 77 | -------------------------------------------------------------------------------- /src/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "php": "~7.1", 4 | "symfony/console": "^4.4" 5 | }, 6 | "bin": [ 7 | "bin/phpstan" 8 | ], 9 | "config": { 10 | "platform": { 11 | "php": "7.1.3" 12 | } 13 | } 14 | } 15 | --------------------------------------------------------------------------------