File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1111use League \Flysystem \Replicate \ReplicateAdapter ;
1212use Yii ;
1313use yii \base \Component ;
14+ use yii \base \InvalidConfigException ;
1415
1516/**
1617 * Filesystem
@@ -81,6 +82,7 @@ abstract protected function prepareAdapter();
8182 /**
8283 * @param \League\Flysystem\AdapterInterface $adapter
8384 * @return \League\Flysystem\AdapterInterface
85+ * @throws InvalidConfigException
8486 */
8587 protected function decorateAdapter ($ adapter )
8688 {
@@ -91,6 +93,10 @@ protected function decorateAdapter($adapter)
9193 /* @var Filesystem $filesystem */
9294 $ filesystem = Yii::$ app ->get ($ this ->replica );
9395
96+ if (!$ filesystem instanceof Filesystem) {
97+ throw new InvalidConfigException ('The "replica" property must be an instance of \creocoder\flysystem\Filesystem subclasses. ' );
98+ }
99+
94100 return new ReplicateAdapter ($ adapter , $ filesystem ->getAdapter ());
95101 }
96102
You can’t perform that action at this time.
0 commit comments