Coder Social home page Coder Social logo

version's Introduction

Hi!

I am Sebastian Bergmann. If you develop software using the PHP programming language then you may have come across my name. I am the creator and maintainer of PHPUnit as well as many other libraries and tools that are commonly used.


๐Ÿ‘ท Check out what I'm currently working on


๐Ÿ”ญ Latest releases I've contributed to


๐Ÿ“ซ How to reach me

version's People

Contributors

ayesh avatar bacinsky avatar henriquemoody avatar jyggen avatar nickcharsley avatar sebastianbergmann avatar systemsolutionweb avatar whatthejeff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

version's Issues

unexpected identifier "string"

Parse error: syntax error, unexpected identifier "string", expecting variable in vendor/sebastian/version/src/Version.php on line 25

This issue found while upgrading Laravel 10x

PHPUnit runner showing wrong version number

Using PHPUnit as a dev requirement in a project (which uses git for version control) and running it using vendor/bin/phpunit will show the most recent tagged version of project instead of the phpunit version.

This can be tracked down to SebastianBergmann\Version::isGitRepository. As the isGitRespository method is recursive to check till the root if there is some .git folder it can show any tag of a parent git repository instead of a phpunit tagged version.

        /**
         * @param  string $path
         * @return boolean
         */
        private function isGitRepository($path)
        {
            if (is_dir($path . DIRECTORY_SEPARATOR . '.git')) {
                return TRUE;
            }

            $path = dirname($path);

            if ($path == '/') { <-- this should be changed to stop at a defined folder (e.g. the phpunit directory in the projects vendor folder)
                return FALSE;
            }

            return $this->isGitRepository($path);
        }

Incorrect Runner_Version::id() when installed via composer inside project git directory

I've PHPUnit 4.3.1 installed using Composer.

$version = new SebastianBergmann\Version('4.3.1', dirname(dirname(__DIR__)));

The problem is that this returns legacy-version-7-belgium-1829-gd13dcc3 instead of the tagged release. When looking at the code it becomes clear that whenever a .git directory is found (recursively) it will always return a git based hash as version.

But the .git directory that is found is the one of my own project (the project root). There is no .git directory inside vendor/phpunit/...

Is there a way to stop this or to limit the level of recursiveness?

Please move code into a subdirectory, SebastianBergmann/Version/autoload.php

When trying to checkout PHPUnit as Git submodules in a project, so that I can fork and modify them, I get this error from CodeCoverage:

  • PHP Fatal error: require_once(): Failed opening required 'SebastianBergmann/Version/autoload.php' in /home/installuser/Dropbox/projects/ischool/website/web/lib/php-code-coverage/PHP/CodeCoverage/Autoload.php on line 49

My include_path is:

  • /home/installuser/Dropbox/projects/ischool/website/tests/../web
  • /home/installuser/Dropbox/projects/ischool/website/tests/../web/lib
  • /home/installuser/Dropbox/projects/ischool/website/tests/../web/lib/phpunit
  • /home/installuser/Dropbox/projects/ischool/website/tests/../web/lib/php-code-coverage
  • .
  • /usr/share/php
  • /usr/share/pear'

There's no way to resolve this without installing the module globally using PEAR (defeating the point of what I was trying to do, and making the code harder to install) or moving the files around.

If you could create the directory:

src/SebastianBergmann/Version

and move src/autoload.php into it, then I could add sebastianbergmann-version/src to my PHP include path, and it would find the files and I would be able to load phpunit and its dependencies from the Git checkout. Thanks :)

getVersion() fails on Windows hosts

When using the getVersion() on a Windows based host it seems that getVersion() gets stuck in an infinite loop while trying to determine if the directory is a Git repo:

 Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\[...]\vendor\sebastian\version\src\Version.php on line 125

Call Stack:
  0.0009     122592   1. {main}() C:\[...]\vendor\sebastian\phpcpd\composer\bin\phpcpd:0
  0.0081     351000   2. SebastianBergmann\PHPCPD\TextUI\Command->__construct() C:\[...]\vendor\sebastian\phpcpd\composer\bin\phpcpd:69
  0.0087     362728   3. SebastianBergmann\Version->getVersion() C:\[...]\vendor\sebastian\phpcpd\src\TextUI\Command.php:68
  0.0087     362864   4. SebastianBergmann\Version->getGitInformation() C:\[...]\vendor\sebastian\version\src\Version.php:81
  0.0087     362904   5. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:103
  0.0092     363080   6. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:135
  0.0095     363176   7. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:135
  0.0099     363272   8. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:135
  0.0102     363360   9. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:135
  0.0105     363440  10. SebastianBergmann\Version->isGitRepository() C:\[...]\vendor\sebastian\version\src\Version.php:135
  [etc]

I checked the code and it seems that the following check fails:

[line: 131] if ($path == '/') {

because on windows $path will be 'C:'

Infinite recursion in latest stable version on windows when not in git repository

When runing phpcpd it uses as a dependency this lib "Version" ant it produces an infinate recursion and uses up all memory, i Installed using pear, so no git hub repository is present.

Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\Pr
ogram Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php on line 125

INSTALLED PACKAGES, CHANNEL PEAR.PHPUNIT.DE:
============================================
PACKAGE                   VERSION STATE
File_Iterator             1.3.3   stable
FinderFacade              1.0.6   stable
PHPUnit                   3.7.19  stable
PHPUnit_MockObject        1.2.3   stable
PHPUnit_SkeletonGenerator 1.2.0   stable
PHP_CodeCoverage          1.2.9   stable
PHP_Timer                 1.0.4   stable
PHP_TokenStream           1.1.5   stable
Text_Template             1.1.4   stable
Version                   1.0.0   stable
phpcpd                    1.4.1   stable
phpdcd                    0.9.3   beta
phploc                    1.7.4   stable
ppw                       1.0.4   stable
Call Stack:
    0.0002     322912   1. {main}() C:\Program Files (x86)\PHP\phpcpd:0
    0.0165     772056   2. SebastianBergmann\PHPCPD\TextUI\Command->__construct(
) C:\Program Files (x86)\PHP\phpcpd:55
    0.0169     797368   3. SebastianBergmann\Version->getVersion() C:\Program Fi
les (x86)\PHP\pear\SebastianBergmann\PHPCPD\TextUI\Command.php:68
    0.0169     797368   4. SebastianBergmann\Version->getGitInformation() C:\Pro
gram Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:81
    0.0169     797368   5. SebastianBergmann\Version->isGitRepository() C:\Progr
am Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:103
    0.0170     797472   6. SebastianBergmann\Version->isGitRepository() C:\Progr
am Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:135
    0.0170     797576   7. SebastianBergmann\Version->isGitRepository() C:\Progr
am Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:135
    0.0171     797672   8. SebastianBergmann\Version->isGitRepository() C:\Progr
am Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:135
    0.0171     797744   9. SebastianBergmann\Version->isGitRepository() C:\Progr
am Files (x86)\PHP\pear\SebastianBergmann\Version\Version.php:135

Modernize build automation

  • Use GitHub Actions instead of Travis CI
  • Have Composer in tools/composer and managed through composer self-update (see update-tools target in build.xml
  • Install Psalm using Phive as tools/psalm (phive install --copy psalm)
  • Install PHP-CS-Fixer using Phive as tools/php-cs-fixer (phive install --copy php-cs-fixer)
  • Create Psalm configuration
  • Add Psalm build step to GitHub Actions-based CI workflow
  • Add PHP-CS-Fixer build step to GitHub Actions-based CI workflow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.