Skip to content

Commit c2a7bbb

Browse files
committed
Merge branch 'main' of https://github.com/malamalca/pures3
2 parents 2aee0a3 + 4ca4d5e commit c2a7bbb

File tree

10 files changed

+46
-13
lines changed

10 files changed

+46
-13
lines changed

src/Calc/GF/TSS/OHTSistemi/Podsistemi/Generatorji/SolarniPaneli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function toplotneIzgubeTSV($vneseneIzgube, $sistem, $cona, $okolje, $par
107107

108108
$U_sc = $this->tip->a1() + $this->tip->a2() * 40 + (5 + 0.5 * $this->povrsina) / $this->povrsina;
109109

110-
$hranilnik = array_first_callback($sistem->hranilniki);
110+
$hranilnik = array_first_callback($sistem->hranilniki, fn($h) => true);
111111
$volumenHranilnika = (float)array_reduce(
112112
$sistem->hranilniki,
113113
fn($sum, $hranilnik) => $sum += $hranilnik->volumen

src/Calc/GF/TSS/OHTSistemi/Podsistemi/Razvodi/RazvodHlajenja.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function toplotneIzgube($vneseneIzgube, $sistem, $cona, $okolje, $params
8484
*/
8585
public function potrebnaElektricnaEnergija($vneseneIzgube, $sistem, $cona, $okolje, $params = [])
8686
{
87-
$generator = array_first_callback($sistem->generatorji);
87+
$generator = array_first_callback($sistem->generatorji, fn($g) => true);
8888

8989
if (!empty($this->crpalka) && !empty($generator->nazivnaMoc)) {
9090
foreach (array_keys(Calc::MESECI) as $mesec) {

src/Calc/GF/TSS/OHTSistemi/Podsistemi/Razvodi/RazvodSolar.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ public function parseConfig($config)
5858
public function analiza($toplotneIzgube, $sistem, $cona, $okolje, $params = [])
5959
{
6060
if (!isset($this->crpalka->moc)) {
61-
$generator = array_first_callback($sistem->generatorji, fn($generatorj) => $generatorj->id == $this->idGeneratorja);
61+
$generator = array_first_callback(
62+
$sistem->generatorji,
63+
fn($generatorj) => $generatorj->id == $this->idGeneratorja
64+
);
6265
if (!$generator) {
6366
throw new \Exception('TSS RazvodSolar: Generator ne obstaja.');
6467
}
@@ -121,7 +124,10 @@ public function potrebnaElektricnaEnergija($vneseneIzgube, $sistem, $cona, $okol
121124
{
122125
$namen = $params['namen'];
123126

124-
$generator = array_first_callback($sistem->generatorji, fn($generatorj) => $generatorj->id == $this->idGeneratorja);
127+
$generator = array_first_callback(
128+
$sistem->generatorji,
129+
fn($generatorj) => $generatorj->id == $this->idGeneratorja
130+
);
125131
if (!$generator) {
126132
throw new \Exception('TSS RazvodSolar: Generator ne obstaja.');
127133
}

src/Calc/GF/TSS/OHTSistemi/Sistemi/Hlajenje.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ public function analiza($toplotneIzgube, OHTSistem $sistem, $cona, $okolje, $par
129129
}
130130

131131
foreach ($this->hranilniki as $hranilnikId) {
132-
$hranilnik = array_first_callback($sistem->hranilniki, fn($hranilnik) => $hranilnik->id == $hranilnikId);
132+
$hranilnik = array_first_callback(
133+
$sistem->hranilniki,
134+
fn($hranilnik) => $hranilnik->id == $hranilnikId
135+
);
133136
if (!$hranilnik) {
134137
throw new \Exception(sprintf('Hranilnik hlajenja "%s" ne obstaja', $hranilnikId));
135138
}

src/Calc/GF/TSS/OHTSistemi/Sistemi/Ogrevanje.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ public function analiza($toplotneIzgube, OHTSistem $sistem, $cona, $okolje, $par
141141
}
142142

143143
foreach ($this->hranilniki as $hranilnikId) {
144-
$hranilnik = array_first_callback($sistem->hranilniki, fn($hranilnik) => $hranilnik->id == $hranilnikId);
144+
$hranilnik = array_first_callback(
145+
$sistem->hranilniki,
146+
fn($hranilnik) => $hranilnik->id == $hranilnikId
147+
);
145148
if (!$hranilnik) {
146149
throw new \Exception(sprintf('Hranilnik ogrevanja "%s" ne obstaja', $hranilnikId));
147150
}

src/Calc/GF/TSS/OHTSistemi/Sistemi/TSV.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ public function analiza($toplotneIzgube, OHTSistem $sistem, $cona, $okolje, $par
110110
}
111111

112112
foreach ($this->hranilniki as $hranilnikId) {
113-
$hranilnik = array_first_callback($sistem->hranilniki, fn($hranilnik) => $hranilnik->id == $hranilnikId);
113+
$hranilnik = array_first_callback(
114+
$sistem->hranilniki,
115+
fn($hranilnik) => $hranilnik->id == $hranilnikId
116+
);
114117
if (!$hranilnik) {
115118
throw new \Exception(sprintf('Hranilnik TSV "%s" ne obstaja', $hranilnikId));
116119
}

src/Controller/Hrup/UdarniHrupController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ public function view($projectId, $konstrukcijaId)
2121
App::set('splosniPodatki', App::loadProjectData('Hrup', $projectId, 'splosniPodatki'));
2222

2323
$locilneKonstrukcije = App::loadProjectCalculation('Hrup', $projectId, 'udarniHrup');
24-
App::set('locilnaKonstrukcija', array_first_callback($locilneKonstrukcije, fn($p) => $konstrukcijaId == $p->id));
24+
App::set('locilnaKonstrukcija', array_first_callback(
25+
$locilneKonstrukcije,
26+
fn($p) => $konstrukcijaId == $p->id
27+
));
2528

2629
App::set('konstrukcije', App::loadProjectCalculation('Hrup', $projectId, 'elementi' . DS . 'konstrukcije'));
2730
}

src/Controller/Hrup/ZracniHrupController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ public function view($projectId, $konstrukcijaId)
2121
App::set('splosniPodatki', App::loadProjectData('Hrup', $projectId, 'splosniPodatki'));
2222

2323
$locilneKonstrukcije = App::loadProjectCalculation('Hrup', $projectId, 'zracniHrup');
24-
App::set('locilnaKonstrukcija', array_first_callback($locilneKonstrukcije, fn($p) => $konstrukcijaId == $p->id));
24+
App::set('locilnaKonstrukcija', array_first_callback(
25+
$locilneKonstrukcije,
26+
fn($p) => $konstrukcijaId == $p->id
27+
));
2528

2629
App::set('konstrukcije', App::loadProjectCalculation('Hrup', $projectId, 'elementi' . DS . 'konstrukcije'));
2730
}

src/Controller/Pures/ConeController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ public function transparentniElement($projectId, $conaId, $konsId)
6969
{
7070
$cone = App::loadProjectCalculation('Pures', $projectId, 'cone');
7171
$cona = array_first_callback($cone, fn($cona) => strtolower($cona->id) == strtolower($conaId));
72-
$k = array_first_callback($cona->ovoj->transparentneKonstrukcije, fn($kn) => strtolower($kn->id) == strtolower($konsId));
72+
$k = array_first_callback(
73+
$cona->ovoj->transparentneKonstrukcije,
74+
fn($kn) => strtolower($kn->id) == strtolower($konsId)
75+
);
7376

7477
App::set('projectId', $projectId);
7578
App::set('cona', $cona);

src/Controller/Pures/TSSController.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public function prezracevanje($projectId, $sistemId, $ref = null)
2626
($ref == 'ref' ? 'Ref' . DS : '') . 'TSS' . DS . 'prezracevanje'
2727
);
2828
App::set('sistemi', $sistemi);
29-
App::set('sistem', array_first_callback($sistemi, fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)));
29+
App::set('sistem', array_first_callback(
30+
$sistemi,
31+
fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)
32+
));
3033
}
3134

3235
/**
@@ -47,7 +50,10 @@ public function razsvetljava($projectId, $sistemId, $ref = null)
4750
($ref == 'ref' ? 'Ref' . DS : '') . 'TSS' . DS . 'razsvetljava'
4851
);
4952
App::set('sistemi', $sistemi);
50-
App::set('sistem', array_first_callback($sistemi, fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)));
53+
App::set('sistem', array_first_callback(
54+
$sistemi,
55+
fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)
56+
));
5157
}
5258

5359
/**
@@ -94,6 +100,9 @@ public function fotovoltaika($projectId, $sistemId)
94100

95101
$sistemi = App::loadProjectCalculation('Pures', $projectId, 'TSS' . DS . 'fotovoltaika');
96102
App::set('sistemi', $sistemi);
97-
App::set('sistem', array_first_callback($sistemi, fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)));
103+
App::set('sistem', array_first_callback(
104+
$sistemi,
105+
fn($sistem) => strtolower($sistem->id) == strtolower($sistemId)
106+
));
98107
}
99108
}

0 commit comments

Comments
 (0)