diff --git a/README.md b/README.md index df2ca37..645eace 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP Phan (Analyzer) -[![Latest Release](https://vsmarketplacebadge.apphb.com/version-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Installs](https://vsmarketplacebadge.apphb.com/installs/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Build Status](https://travis-ci.org/TysonAndre/vscode-php-phan.svg?branch=master)](https://travis-ci.org/TysonAndre/vscode-php-phan) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E=7.1-8892BF.svg)](https://php.net/) [![Gitter](https://badges.gitter.im/phan/phan.svg)](https://gitter.im/phan/phan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Latest Release](https://vsmarketplacebadge.apphb.com/version-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Installs](https://vsmarketplacebadge.apphb.com/installs/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Build Status](https://travis-ci.org/TysonAndre/vscode-php-phan.svg?branch=master)](https://travis-ci.org/TysonAndre/vscode-php-phan) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E=7.0-8892BF.svg)](https://php.net/) [![Gitter](https://badges.gitter.im/phan/phan.svg)](https://gitter.im/phan/phan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) **Supports Unix/Linux.** As of version 0.2.0, this has experimental support for Windows (Not as fast or well tested). @@ -21,7 +21,7 @@ However, bugs in this VS code extension (crashes, etc) or related to the languag ### Dependencies: -1. PHP 7.1+ must be installed. +1. PHP 7.0+ must be installed. You can either add it to your PATH or set the `phan.executablePath` setting. 2. `pcntl` is recommended. (Available on Unix/Linux) (Phan's Language Server Protocol support depends on `pcntl` module being installed, which is only available on those platforms) @@ -47,8 +47,10 @@ Add these entries to your VSCode config (Open the menu at File > Preferences > S // On windows, this would be a path such as "C:\\Users\\MyUser\\path\\to\\analyzed\\folder" "phan.analyzedProjectDirectory": "/path/to/folder/to/analyze", - // Path to a php 7.1+ binary (preferably with the php-ast PECL extension installed and enabled) - // On windows, this would be "C:\\path\\to\\php-7.1-installation\\php.exe" + // Path to a php 7.0+ binary (preferably with the php-ast PECL extension installed and enabled) + // This should be as similar as possible as the php installation used to run Phan + // (Same php minor version, same extensions or phan internal stubs for extensions (excluding xdebug), etc.) + // On windows, this would be "C:\\path\\to\\php-7.0-installation\\php.exe" "phan.phpExecutablePath": "/path/to/php7.1", // Files which this should analyze @@ -126,6 +128,13 @@ General troubleshooting advice: ## Release History +### 0.3.0 (2018-02-18) + +- Add initial support for analyzing code for different php minor versions (PHP 7.0, 7.1, and 7.2). + Previously, this extension acted as though the codebase used php 7.1. + For best results, the PHP binary used to run Phan should be the same minor version as the PHP 7.x version used to run the codebase. +- See [Phan's NEWS](https://raw.githubusercontent.com/phan/phan/0.12.0/NEWS.md) for more details. + ### 0.2.0 (2018-02-18) - Allow running this extension without `pcntl` installed. (`pcntl` was not available for Windows) diff --git a/composer.json b/composer.json index df6fd68..8694661 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,6 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "phan/phan": "dev-master" + "phan/phan": "0.12.0" } } diff --git a/composer.lock b/composer.lock index fd18021..97269f9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,70 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "ad6d5f0e6384ed6a2e3aba7a53aa5140", + "content-hash": "2c862df5e4fbcbdebcd0fbdec278e4fc", "packages": [ + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "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": "2016-08-30T16:08:34+00:00" + }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.0.1", @@ -132,23 +194,24 @@ }, { "name": "phan/phan", - "version": "dev-master", + "version": "0.12.0", "source": { "type": "git", "url": "https://github.com/phan/phan.git", - "reference": "b784c6e6a28e7e3fc2188ac9d210abbcad46e94f" + "reference": "a19241bf2ff9c94fad665afade533ca815b251dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phan/phan/zipball/b784c6e6a28e7e3fc2188ac9d210abbcad46e94f", - "reference": "b784c6e6a28e7e3fc2188ac9d210abbcad46e94f", + "url": "https://api.github.com/repos/phan/phan/zipball/a19241bf2ff9c94fad665afade533ca815b251dd", + "reference": "a19241bf2ff9c94fad665afade533ca815b251dd", "shasum": "" }, "require": { + "composer/semver": "^1.4", "ext-ast": "^0.1.5", "felixfbecker/advanced-json-rpc": "^3.0", "microsoft/tolerant-php-parser": "0.0.9", - "php": "~7.1.0 || ~7.2.0", + "php": "^7.0.0", "sabre/event": "^5.0", "symfony/console": "^2.3|^3.0|~4.0" }, @@ -187,7 +250,7 @@ "php", "static" ], - "time": "2018-02-20T00:40:37+00:00" + "time": "2018-02-26T00:28:37+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -582,9 +645,7 @@ "packages-dev": [], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "phan/phan": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": [], diff --git a/package-lock.json b/package-lock.json index 8adb645..731cac9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "php-phan", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3097,9 +3097,9 @@ } }, "vsce": { - "version": "1.36.3", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.36.3.tgz", - "integrity": "sha512-FsOMcZpB9KCk/RU09CCWw95i2AkCwtuF4beRQtiWsv2WPrxA0IE3oj7wEEgkwwZeym459oWYaSFBzmYuifJETg==", + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.37.1.tgz", + "integrity": "sha512-sguQ99sjT0moiFvo5M+2pT70O04IeS6iIePxTY2GuH+VlgJ5UMECCriIcZ09McuzBpe73LuDeLSDspawoz0sHw==", "dev": true, "requires": { "cheerio": "1.0.0-rc.2", diff --git a/package.json b/package.json index c81b1a9..032bf34 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "MIT", "private": true, "preview": false, - "version": "0.2.0", + "version": "0.3.0", "engines": { "vscode": "^1.16.0", "os": [ @@ -55,7 +55,7 @@ "@types/semver": "^5.5.0", "tslint": "^5.7.0", "typescript": "^2.7.2", - "vsce": "^1.36.3", + "vsce": "^1.37.1", "vscode": "^1.1.0" }, "dependencies": { diff --git a/src/extension.ts b/src/extension.ts index 377c0f8..390960b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -105,7 +105,6 @@ async function checkPHPPcntlInstalled(context: vscode.ExtensionContext, phpExecu return true; } - function isFile(path: string): boolean { try { let stat = fs.statSync(path);