|
@@ -85,6 +85,26 @@ final class ProcessOutput implements ProcessOutputInterface
|
|
|
$this->eventDispatcher->removeListener(FixerFileProcessedEvent::NAME, [$this, 'onFixerFileProcessed']);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * This class is not intended to be serialized,
|
|
|
+ * and cannot be deserialized (see __wakeup method).
|
|
|
+ */
|
|
|
+ public function __sleep()
|
|
|
+ {
|
|
|
+ throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Disable the deserialization of the class to prevent attacker executing
|
|
|
+ * code by leveraging the __destruct method.
|
|
|
+ *
|
|
|
+ * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection
|
|
|
+ */
|
|
|
+ public function __wakeup()
|
|
|
+ {
|
|
|
+ throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
|
|
+ }
|
|
|
+
|
|
|
public function onFixerFileProcessed(FixerFileProcessedEvent $event)
|
|
|
{
|
|
|
$status = self::$eventStatusMap[$event->getStatus()];
|