Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Fixes #216 remove \Exception type hint #217

Merged
merged 4 commits into from
Sep 8, 2016

Conversation

samsonasik
Copy link
Contributor

No description provided.

@Ocramius
Copy link
Member

@samsonasik can you verify it with a test? Doing something like following should suffice:

try {
    (new \stdClass)->iDoNotExist();
} catch (\Throwable $exception) { 
    $serializable = new SerializableException($exception);
   // assert here
}

// fail if no $exception thrown

@samsonasik
Copy link
Contributor Author

@Ocramius (new \stdClass)->iDoNotExist(); will result Error in php7

@Ocramius
Copy link
Member

It will be a throwable instance

@samsonasik
Copy link
Contributor Author

@Ocramius I got this error:

...PHP Fatal error:  Uncaught TypeError: Argument 1 passed to ZendDeveloperTools\Exception\SerializableException::__construct() must be an instance of Exception, instance of Error given,

@Ocramius
Copy link
Member

@samsonasik
Copy link
Contributor Author

@Ocramius done ;), tests added, should be ok now ;)

}
}

public function testStdClassCallNotExistMethod()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test requires PHP 7 - you can use the PHPUnit annotation for that

@samsonasik
Copy link
Contributor Author

@Ocramius tests updated. Travis now green \m/

@snapshotpl
Copy link
Contributor

Anyone can merge it? It fail on my php7 dev machine ;(

@DannyvdSluijs
Copy link

I would also like this to be merged.

@ikovalyov
Copy link

+1 please merge

@vladas
Copy link

vladas commented Aug 17, 2016

@samsonasik Is there any reason you removed the type hinting? Exception and Error are instances of Throwable. In my mind it should have been enough to replace \Exception with \Throwable.

@samsonasik
Copy link
Contributor Author

\Throwable only works with php7, we use it in php ^5.6

@DannyvdSluijs
Copy link

@vladas \Throwable is only availible from PHP7. It would break any compatibility with 5.X

@vladas
Copy link

vladas commented Aug 17, 2016

Ok, fair enough.

@MatthiasKuehneEllerhold
Copy link
Contributor

Any news on this PR?

@weierophinney weierophinney added this to the 1.1.1 milestone Sep 8, 2016
@weierophinney weierophinney merged commit 78afa02 into zendframework:master Sep 8, 2016
weierophinney added a commit that referenced this pull request Sep 8, 2016
Fixes #216 remove \Exception type hint
weierophinney added a commit that referenced this pull request Sep 8, 2016
weierophinney added a commit that referenced this pull request Sep 8, 2016
weierophinney added a commit that referenced this pull request Sep 8, 2016
@weierophinney
Copy link
Member

Thanks, @samsonasik

@samsonasik samsonasik deleted the patch-3 branch September 8, 2016 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants