Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Adding Dependency Tracking Ability
Browse files Browse the repository at this point in the history
  • Loading branch information
artberri committed Feb 22, 2017
1 parent 1274999 commit 0b447d9
Show file tree
Hide file tree
Showing 28 changed files with 713 additions and 826 deletions.
20 changes: 7 additions & 13 deletions ApplicationInsights/Channel/Contracts/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
namespace ApplicationInsights\Channel\Contracts;

/**
* Data contract class for type Application.
* Data contract class for type Application.
*/
class Application
{
use Json_Serializer;

/**
* Data array that will store all the values.
* Data array that will store all the values.
*/
private $_data;

/**
* Creates a new Application.
* Creates a new Application.
*/
function __construct()
{
$this->_data = array();
}

/**
* Gets the ver field.
* Gets the ver field.
*/
public function getVer()
{
Expand All @@ -29,18 +31,10 @@ public function getVer()
}

/**
* Sets the ver field.
* Sets the ver field.
*/
public function setVer($ver)
{
$this->_data['ai.application.ver'] = $ver;
}

/**
* Overrides JSON serialization for this class.
*/
public function jsonSerialize()
{
return Utils::removeEmptyValues($this->_data);
}
}
59 changes: 59 additions & 0 deletions ApplicationInsights/Channel/Contracts/Base_Data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
namespace ApplicationInsights\Channel\Contracts;

/**
* Data contract class for type Event_Data.
*/
abstract class Base_Data implements Data_Interface
{
use Json_Serializer;
use Version_Manager;

/**
* Data array that will store all the values.
*/
protected $_data;

/**
* Needed to properly construct the JSON envelope.
*/
protected $_envelopeTypeName;

/**
* Needed to properly construct the JSON envelope.
*/
protected $_dataTypeName;

/**
* Gets the envelopeTypeName field.
*/
public function getEnvelopeTypeName()
{
return $this->_envelopeTypeName;
}

/**
* Gets the dataTypeName field.
*/
public function getDataTypeName()
{
return $this->_dataTypeName;
}

/**
* Gets the properties field.
*/
public function getProperties()
{
if (array_key_exists('properties', $this->_data)) { return $this->_data['properties']; }
return NULL;
}

/**
* Sets the properties field.
*/
public function setProperties($properties)
{
$this->_data['properties'] = $properties;
}
}
24 changes: 9 additions & 15 deletions ApplicationInsights/Channel/Contracts/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
namespace ApplicationInsights\Channel\Contracts;

/**
* Data contract class for type Data.
* Data contract class for type Data.
*/
class Data
{
use Json_Serializer;

/**
* Data array that will store all the values.
* Data array that will store all the values.
*/
private $_data;

/**
* Creates a new Data.
* Creates a new Data.
*/
function __construct()
{
$this->_data['baseData'] = NULL;
}

/**
* Gets the baseType field.
* Gets the baseType field.
*/
public function getBaseType()
{
Expand All @@ -29,15 +31,15 @@ public function getBaseType()
}

/**
* Sets the baseType field.
* Sets the baseType field.
*/
public function setBaseType($baseType)
{
$this->_data['baseType'] = $baseType;
}

/**
* Gets the baseData field.
* Gets the baseData field.
*/
public function getBaseData()
{
Expand All @@ -46,18 +48,10 @@ public function getBaseData()
}

/**
* Sets the baseData field.
* Sets the baseData field.
*/
public function setBaseData($baseData)
{
$this->_data['baseData'] = $baseData;
}

/**
* Overrides JSON serialization for this class.
*/
public function jsonSerialize()
{
return Utils::removeEmptyValues($this->_data);
}
}
43 changes: 43 additions & 0 deletions ApplicationInsights/Channel/Contracts/Data_Interface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
namespace ApplicationInsights\Channel\Contracts;

/**
* Interface class for XXXXX_Data.
*/
interface Data_Interface
{
/**
* Gets the envelopeTypeName field.
*/
public function getEnvelopeTypeName();

/**
* Gets the dataTypeName field.
*/
public function getDataTypeName();

/**
* Gets the ver field.
*/
public function getVer();

/**
* Sets the ver field.
*/
public function setVer($ver);

/**
* Gets the properties field.
*/
public function getProperties();

/**
* Sets the properties field.
*/
public function setProperties($properties);

/**
* JSON serialization for this class.
*/
public function jsonSerialize();
}
44 changes: 19 additions & 25 deletions ApplicationInsights/Channel/Contracts/Data_Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
namespace ApplicationInsights\Channel\Contracts;

/**
* Data contract class for type Data_Point.
* Data contract class for type Data_Point.
*/
class Data_Point
{
use Json_Serializer;

/**
* Data array that will store all the values.
* Data array that will store all the values.
*/
private $_data;

/**
* Creates a new DataPoint.
* Creates a new DataPoint.
*/
function __construct()
{
Expand All @@ -22,7 +24,7 @@ function __construct()
}

/**
* Gets the name field.
* Gets the name field.
*/
public function getName()
{
Expand All @@ -31,15 +33,15 @@ public function getName()
}

/**
* Sets the name field.
* Sets the name field.
*/
public function setName($name)
{
$this->_data['name'] = $name;
}

/**
* Gets the kind field.
* Gets the kind field.
*/
public function getKind()
{
Expand All @@ -48,15 +50,15 @@ public function getKind()
}

/**
* Sets the kind field.
* Sets the kind field.
*/
public function setKind($kind)
{
$this->_data['kind'] = $kind;
}

/**
* Gets the value field.
* Gets the value field.
*/
public function getValue()
{
Expand All @@ -65,15 +67,15 @@ public function getValue()
}

/**
* Sets the value field.
* Sets the value field.
*/
public function setValue($value)
{
$this->_data['value'] = $value;
}

/**
* Gets the count field.
* Gets the count field.
*/
public function getCount()
{
Expand All @@ -82,15 +84,15 @@ public function getCount()
}

/**
* Sets the count field.
* Sets the count field.
*/
public function setCount($count)
{
$this->_data['count'] = $count;
}

/**
* Gets the min field.
* Gets the min field.
*/
public function getMin()
{
Expand All @@ -99,15 +101,15 @@ public function getMin()
}

/**
* Sets the min field.
* Sets the min field.
*/
public function setMin($min)
{
$this->_data['min'] = $min;
}

/**
* Gets the max field.
* Gets the max field.
*/
public function getMax()
{
Expand All @@ -116,15 +118,15 @@ public function getMax()
}

/**
* Sets the max field.
* Sets the max field.
*/
public function setMax($max)
{
$this->_data['max'] = $max;
}

/**
* Gets the stdDev field.
* Gets the stdDev field.
*/
public function getStdDev()
{
Expand All @@ -133,18 +135,10 @@ public function getStdDev()
}

/**
* Sets the stdDev field.
* Sets the stdDev field.
*/
public function setStdDev($stdDev)
{
$this->_data['stdDev'] = $stdDev;
}

/**
* Overrides JSON serialization for this class.
*/
public function jsonSerialize()
{
return Utils::removeEmptyValues($this->_data);
}
}
Loading

0 comments on commit 0b447d9

Please sign in to comment.