Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagick #97

Open
Sarke opened this issue Feb 27, 2019 · 2 comments
Open

Imagick #97

Sarke opened this issue Feb 27, 2019 · 2 comments
Labels
enhancement New feature or request missing function

Comments

@Sarke
Copy link

Sarke commented Feb 27, 2019

It's a common extension and lots of their methods return false on failure, which is frustrating.

How would I go about adding it?

Great repo btw!

@jderusse
Copy link
Contributor

jderusse commented Feb 28, 2019

The current implementation of Safe rewrite only functions, and could not cover the Imagick classes.

Unless refactoring Safe in order to take Class into account and generate something like:

namespace Safe;
class Imagick extends \Imagick
{
   public function fooBar(type $arg)
   {
      error_clear_last();
      $result = parent::fooBar($arg);
      if ($result === false) {
        throw ApacheException::createFromPhpError();
      }
      return $result;
   }
}

ping @moufmouf what do you think?

edit: duplicate of #7

@moufmouf
Copy link
Member

moufmouf commented Mar 6, 2019

Exactly! Overloading classes is harder than overloading functions and I haven't had time to crack the issue yet.

If anyone is feeling up to the task, do not hesitate to give me a hand :)

@shish shish added missing function enhancement New feature or request labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request missing function
Projects
None yet
Development

No branches or pull requests

4 participants