From c873abc2045e2b2d17eecac3c599a1b655eca9dd Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Tue, 3 Nov 2020 11:34:37 -0700 Subject: [PATCH] Prevent a HiddenFiles class from being instantiated without using fromConfig() --- app/src/HiddenFiles.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/HiddenFiles.php b/app/src/HiddenFiles.php index 6fec290..f4e1ccd 100644 --- a/app/src/HiddenFiles.php +++ b/app/src/HiddenFiles.php @@ -2,10 +2,23 @@ namespace App; +use BadMethodCallException; use Tightenco\Collect\Support\Collection; class HiddenFiles extends Collection { + /** {@inheritdoc} */ + protected function __construct(...$args) + { + parent::__construct(...$args); + } + + /** {@inheritdoc} */ + public static function make($items = []) + { + throw new BadMethodCallException('Method not implemented'); + } + /** Create a new HiddenFiles collection object. */ public static function fromConfig(Config $config): self {