- Issue created by @mondrake
- 🇬🇧United Kingdom joachim
In some cases, the invalid plugin is expected -- such as the case handled by 🐛 Changing plugins from annotations to attributes in contrib leads to error if plugin extends from a missing dependency Needs review . I thought using exceptions as messages was a bad pattern?
- 🇬🇧United Kingdom longwave UK
Well the code just does this:
['id' => $id, 'content' => $content] = $this->parseClass($class, $fileinfo); if ($id) { $definitions[$id] = $content; // Explicitly serialize this to create a new object instance. $this->fileCache->set($fileinfo->getPathName(), ['id' => $id, 'content' => serialize($content)]); } else { // Store a NULL object, so the file is not parsed again. $this->fileCache->set($fileinfo->getPathName(), [NULL]); }
So really it's just replacing that
$id
check with a catch? Or, we also allow parseClass to return just NULL directly instead of an array of NULLs? - 🇮🇹Italy mondrake 🇮🇹
My 0.02$: throwing/catching something like an
InvalidPluginClassException
would be best - clean, unambiguous, testable