Skip to content

Commit

Permalink
Merge pull request #23 from tomtomsen/impact_is_not_set
Browse files Browse the repository at this point in the history
impact is not set correctly
  • Loading branch information
enygma committed Jun 2, 2014
2 parents cd67913 + caaeb87 commit c14da43
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 53 deletions.
66 changes: 33 additions & 33 deletions src/Expose/Manager.php
Expand Up @@ -78,11 +78,11 @@ class Manager

/**
* Init the object and assign the filters
*
*
* @param \Expose\FilterCollection $filters Set of filters
*/
public function __construct(
\Expose\FilterCollection $filters,
\Expose\FilterCollection $filters,
\Psr\Log\LoggerInterface $logger = null,
\Expose\Queue $queue = null
)
Expand All @@ -99,7 +99,7 @@ public function __construct(

/**
* Run the filters against the given data
*
*
* @param array $data Data to run filters against
*/
public function run(array $data, $queueRequests = false, $notify = false)
Expand All @@ -113,10 +113,10 @@ public function run(array $data, $queueRequests = false, $notify = false)

$this->setData($data);
$data = $this->getData();
$impact = $this->impact;

$path = array();
$filterMatches = $this->runFilters($data, $path);
$impact = $this->impact;

// Check our threshold to see if we even need to send
$threshold = $this->getThreshold();
Expand All @@ -131,7 +131,7 @@ public function run(array $data, $queueRequests = false, $notify = false)

/**
* Send the notification of the matching filters
*
*
* @param array $filterMatches Set of matching filter results
* @return boolean Success/fail of notification send
*/
Expand All @@ -145,7 +145,7 @@ public function sendNotification($filterMatches)

/**
* Run through the filters on the given data
*
*
* @param array $data Data to check
* @param array $path Current "path" in the data
* @param integer $lvl Current nesting level
Expand Down Expand Up @@ -184,7 +184,7 @@ public function runFilters($data, $path, $lvl = 0)
$this->runFilters($value, $path, $l)
);
} else {

$p = implode('.', $path);

// See if we have restrictions & if the path matches
Expand Down Expand Up @@ -222,7 +222,7 @@ public function runFilters($data, $path, $lvl = 0)

/**
* If enabled, send the notification of the test run
*
*
* @param array $filterMatches Set of matches against filters
* @throws \InvalidArgumentException If notify type is inavlid
*/
Expand All @@ -239,7 +239,7 @@ public function notify(array $filterMatches)

/**
* Log the request information
*
*
* @param array $requestData Request data
*/
public function logRequest($requestData)
Expand All @@ -251,7 +251,7 @@ public function logRequest($requestData)
/**
* Get the current queue object
* If none is set, throws an exception, we need it!
*
*
* @return object Queue instance
*/
public function getQueue()
Expand All @@ -265,7 +265,7 @@ public function getQueue()
/**
* Set the current queue object
* Extends \Expose\Queue
*
*
* @param object $queue Queue instance
*/
public function setQueue($queue)
Expand All @@ -275,7 +275,7 @@ public function setQueue($queue)

/**
* Set the notification method for the results
*
*
* @param \Expose\Notify $notify Notification object
*/
public function setNotify($notify)
Expand All @@ -285,7 +285,7 @@ public function setNotify($notify)

/**
* Get the notification method for the results
*
*
* @return \Expose\Notify instance
*/
public function getNotify()
Expand All @@ -295,7 +295,7 @@ public function getNotify()

/**
* Get the current set of reports
*
*
* @return array Set of \Expose\Reports
*/
public function getReports()
Expand All @@ -305,7 +305,7 @@ public function getReports()

/**
* Get the current overall impact score
*
*
* @return integer Impact score
*/
public function getImpact()
Expand All @@ -315,7 +315,7 @@ public function getImpact()

/**
* Set the overall impact value of the execution
*
*
* @param integer $impact Impact value
*/
public function setImpact($impact)
Expand All @@ -325,7 +325,7 @@ public function setImpact($impact)

/**
* Set the source data for the execution
*
*
* @param array $data Data to validate
*/
public function setData(array $data)
Expand All @@ -335,7 +335,7 @@ public function setData(array $data)

/**
* Get the current source data
*
*
* @return array Source data
*/
public function getData()
Expand All @@ -345,7 +345,7 @@ public function getData()

/**
* Set the filters for the current validation
*
*
* @param \Expose\FilterCollection $filters Filter collection
*/
public function setFilters(\Expose\FilterCollection $filters)
Expand All @@ -355,7 +355,7 @@ public function setFilters(\Expose\FilterCollection $filters)

/**
* Get the current set of filters
*
*
* @return \Expose\FilterCollection Filter collection
*/
public function getFilters()
Expand All @@ -365,7 +365,7 @@ public function getFilters()

/**
* Add a variable name for an exception
*
*
* @param string $varName Variable name
*/
public function setException($path)
Expand All @@ -376,7 +376,7 @@ public function setException($path)

/**
* Get a list of all exceptions
*
*
* @return array Exception list
*/
public function getExceptions()
Expand All @@ -386,7 +386,7 @@ public function getExceptions()

/**
* Add a path to restrict the checking to
*
*
* @param string|array $path Path(s) to add to the restrictions
*/
public function setRestriction($path)
Expand All @@ -397,7 +397,7 @@ public function setRestriction($path)

/**
* Get the list of all current restrictions
*
*
* @return array Set of restrictions
*/
public function getRestrictions()
Expand Down Expand Up @@ -444,7 +444,7 @@ public function setLogDatabase($dbname)
/**
* Test to see if a variable is an exception
* Checks can be exceptions, so we preg_match it
*
*
* @param string $path Variable "path" (Ex. "POST.foo.bar")
* @return boolean Found/not found
*/
Expand All @@ -464,7 +464,7 @@ public function isException($path)

/**
* Set the current instance's logger object
*
*
* @param object $logger PSR-3 compatible Logger instance
*/
public function setLogger($logger)
Expand All @@ -475,7 +475,7 @@ public function setLogger($logger)
/**
* Get the current logger instance
* If it's not set, throw an exception - we need it!
*
*
* @return object PSR-3 compatible logger object
*/
public function getLogger()
Expand All @@ -488,7 +488,7 @@ public function getLogger()

/**
* Set the configuration for the object
*
*
* @param array|string $config Either an array of config settings
* or the path to the config file
* @throws \InvalidArgumentException If config file doesn't exist
Expand All @@ -512,7 +512,7 @@ public function setConfig($config)

/**
* Get the configuration object/settings
*
*
* @return \Expose\Config object
*/
public function getConfig()
Expand All @@ -532,7 +532,7 @@ public function setThreshold($threshold)

/**
* Get the current threshold value
*
*
* @return integer Threshold value (numeric)
*/
public function getThreshold()
Expand All @@ -542,7 +542,7 @@ public function getThreshold()

/**
* Set the cache object
*
*
* @param ExposeCache $cache Cache instance
*/
public function setCache(\Expose\Cache $cache)
Expand All @@ -552,7 +552,7 @@ public function setCache(\Expose\Cache $cache)

/**
* Get the current cache instance
*
*
* @return mixed Either a \Expose\Cache instance or null
*/
public function getCache()
Expand All @@ -562,7 +562,7 @@ public function getCache()

/**
* Expose the current set of reports in the given format
*
*
* @param string $format Fromat for the export
* @return mixed Report output (or null if the export type isn't found)
*/
Expand Down

0 comments on commit c14da43

Please sign in to comment.