protected function checkIntegrity($currentSelection, $oldSelection)
    {
        $metadataExists = property_exists($currentSelection, 'metadata') && property_exists($currentSelection->metadata, 'name');

        $prefExists = property_exists($currentSelection, 'preferences') && property_exists($currentSelection->preferences, 'fontPref')
            && property_exists($currentSelection->preferences->fontPref, 'metadata') && property_exists($currentSelection->preferences->fontPref->metadata, 'fontFamily') ;

        if (($metadataExists && $currentSelection->metadata->name !== 'tao')
            || ($prefExists && $currentSelection->preferences->fontPref->metadata->fontFamily !== 'tao')
            || (!$prefExists && !$metadataExists)
        ) {
            return array('error' => __('You need to change the font name to "tao" in the icomoon preferences'));
        }
        $newSet = $this->dataToGlyphSet($currentSelection);
        $oldSet = $this->dataToGlyphSet($oldSelection);

        return !!count(array_diff($oldSet, $newSet))
            ? array('error' => __('Font incomplete!  Is the extension in sync width git?  Have you removed any glyphs?'))
            : true;
    }
protected function checkIntegrity($currentSelection, $oldSelection)
    {
        $metadataExists = property_exists($currentSelection, 'metadata') && property_exists($currentSelection->metadata, 'name');

        $prefExists = property_exists($currentSelection, 'preferences') && property_exists($currentSelection->preferences, 'fontPref')
            && property_exists($currentSelection->preferences->fontPref, 'metadata') && property_exists($currentSelection->preferences->fontPref->metadata, 'fontFamily') ;

        if (($metadataExists && $currentSelection->metadata->name !== 'tao')
            || ($prefExists && $currentSelection->preferences->fontPref->metadata->fontFamily !== 'tao')
            || (!$prefExists && !$metadataExists)
        ) {
            return array('error' => __('You need to change the font name to "tao" in the icomoon preferences'));
        }
        $newSet = $this->dataToGlyphSet($currentSelection);
        $oldSet = $this->dataToGlyphSet($oldSelection);

        return !!count(array_diff($oldSet, $newSet))
            ? array('error' => __('Font incomplete!  Is the extension in sync width git?  Have you removed any glyphs?'))
            : true;
    }
protected function checkIntegrity ( $ currentSelection , $ oldSelection ) { $ metadataExists = property_exists ( $ currentSelection , 'metadata' ) && property_exists ( $ currentSelection -> metadata , 'name' ) ; $ prefExists = property_exists ( $ currentSelection , 'preferences' ) && property_exists ( $ currentSelection -> preferences , 'fontPref' ) && property_exists ( $ currentSelection -> preferences -> fontPref , 'metadata' ) && property_exists ( $ currentSelection -> preferences -> fontPref -> metadata , 'fontFamily' ) ; if ( ( $ metadataExists && $ currentSelection -> metadata -> name !== 'tao' ) || ( $ prefExists && $ currentSelection -> preferences -> fontPref -> metadata -> fontFamily !== 'tao' ) || ( ! $ prefExists && ! $ metadataExists ) ) { return array ( 'error' => __ ( 'You need to change the font name to "tao" in the icomoon preferences' ) ) ; } $ newSet = $ this -> dataToGlyphSet ( $ currentSelection ) ; $ oldSet = $ this -> dataToGlyphSet ( $ oldSelection ) ; return ! ! count ( array_diff ( $ oldSet , $ newSet ) ) ? array ( 'error' => __ ( 'Font incomplete!  Is the extension in sync width git?  Have you removed any glyphs?' ) ) : true ; }
Checks whether the new font contains at least all glyphs from the previous version

@param $currentSelection
@param $oldSelection
@return bool|array
Checks whether the new font contains at least all glyphs from the previous version