Skip to content

Commit

Permalink
* Changed isset to array_key_exists, to allow null values
Browse files Browse the repository at this point in the history
- Removed unused code
  • Loading branch information
pmaselkowski committed Sep 22, 2014
1 parent a23ec88 commit 38de338
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
20 changes: 6 additions & 14 deletions Maslosoft/Signals/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ class Utility extends CComponent

private $_data = [
Signal::slots => [

],
Signal::signals => [

]
];

Expand All @@ -34,10 +32,10 @@ public function generate()
'SignalFor'
];
$paths = [];
foreach(Yii::app()->signal->searchAliases as $alias)
foreach (Yii::app()->signal->searchAliases as $alias)
{
$path = Yii::getPathOfAlias($alias);
if($path)
if ($path)
{
$paths[] = $path;
}
Expand All @@ -58,20 +56,20 @@ public function processFile($file)
// Create alias for current file
$namespace = AnnotationUtility::rawAnnotate($file)['namespace'];
$className = AnnotationUtility::rawAnnotate($file)['className'];

// Remove global `\` namespace
$namespace = preg_replace('~^\\\\+~', '', $namespace);

// Create alias or fully namespaced class name
/**
* TODO Investigate this case, this is only workaround
*/
if(!is_string($namespace))
if (!is_string($namespace))
{
// var_dump($file);
return false;
}
if(strstr($namespace, '\\'))
if (strstr($namespace, '\\'))
{
// Use namespaced name, class must autoload
$alias = $namespace . '\\' . $className;
Expand Down Expand Up @@ -140,7 +138,7 @@ private function _getValuesFor($src)
$value = [];
foreach ($src as $val)
{
if(!isset($val['value']))
if (!array_key_exists('value', $val))
{
continue;
}
Expand All @@ -157,10 +155,4 @@ private function _getValuesFor($src)
return array_values(array_unique($value));
}

private function _getAlias($val, $file)
{

return $alias;
}

}
7 changes: 7 additions & 0 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_55
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>signals</name>
</data>
</configuration>
</project>

0 comments on commit 38de338

Please sign in to comment.