Created
July 12, 2012 13:34
-
-
Save e2thex/3098139 to your computer and use it in GitHub Desktop.
Plugin Factory validatePluginInfoElement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Validate that the plugin info array contains the all of the required keys | |
| * | |
| * @param $plugin_info | |
| * @param $element_key | |
| * @param $element | |
| * | |
| * @throws Exception\InvalidPluginException | |
| * | |
| * | |
| * @return \Drupal\sps\PluginFactory | |
| * self | |
| */ | |
| protected function validatePluginInfoElement($plugin_info, $element_key, $element) { | |
| if (is_array($element)) { | |
| if (!isset($plugin_info[$element_key])) { | |
| throw new InvalidPluginException( | |
| "Plugin {$plugin_info['name']} does not contain required element $element_key"); | |
| } | |
| } | |
| else { | |
| if (!isset($plugin_info[$element])) { | |
| throw new InvalidPluginException( | |
| "Plugin {$plugin_info['name']} does not contain required element $element"); | |
| } | |
| } | |
| return $this; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I am thining that this function does not do what it is suppose to do, but I want to see if you had any idea on what it might be trying to do?