function toPseudoNestedArray(array $array) {
$result = [];
$resultingKey = '';
($closure = function (array $array) use (&$result, &$resultingKey, &$closure) {
foreach ($array as $key => $value) {
if (is_array($value)) {
$currentKey = $resultingKey;
if ($resultingKey) {
$resultingKey .= '[' . $key . ']';
} else {
$resultingKey .= $key;
}
$closure($value);
$resultingKey = $currentKey;
} else {
$result[$resultingKey ? $resultingKey . '[' . $key . ']' : $key] = $value;
}
}
})($array);
return $result;
}
/**
* Recursively get all sub-companies IDs
*/
private function getSubcompaniesIds(CompanyInterface $company): array
{
$ids = [];
($recursive = function ($company) use (&$ids, &$recursive) {
$childCompanies = $this->companyRelationsResolver->getChildCompanies($company)->getItems();
foreach ($childCompanies as $childCompany) {
$ids[] = $childCompany->getId();
$recursive($childCompany);
}
})($company);
return $ids;
}
<VirtualHost *:443>
...
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
.parent {
display: table;
}
.first, .second {
display: table-cell;
vertical-align: top;
}
.first {
width: 100px;
height: 100px;
background: red;
}
<meta http-equiv="Refresh" content="80">
gulp.task("uglify", function () {
return gulp.src('./resources/assets/js/*.js')
.pipe(babel({
"presets": [
[ "es2015", { "modules": false } ]
]
}))
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('./public/js'));
});
function htmlToDOM(html)
{
let parser = new DOMParser();
return parser.parseFromString(html, "text/html").getElementsByTagName('body')[0].firstChild;
}
function htmlToDOM(html)
{
let temp = document.createElement("div");
temp.innerHTML = html;
return temp.firstChild;
}
if(!$('.login-form')[0].checkValidity()) {
$('.login-form__submit').off( "click" ).click().click(function (e) {
e.preventDefault();
tryToLogin();
});
return false;
}